Skip to content

Commit

Permalink
Merge pull request #1944 from ardriveapp/PE-6964-add-primary-name-and…
Browse files Browse the repository at this point in the history
…-logo-on-welcome-back-page

PE-6964: add primary name and logo on welcome back page
  • Loading branch information
thiagocarvalhodev authored Dec 19, 2024
2 parents 1c0cdfc + 1484fe6 commit df630bd
Show file tree
Hide file tree
Showing 24 changed files with 680 additions and 292 deletions.
6 changes: 3 additions & 3 deletions lib/arns/domain/arns_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ abstract class ARNSRepository {
Future<sdk.ARNSUndername> getUndernameByDomainAndName(
String domain, String name);
Future<PrimaryNameDetails> getPrimaryName(String address,
{bool update = false});
{bool update = false, bool getLogo = true});

factory ARNSRepository({
required ArioSDK sdk,
Expand Down Expand Up @@ -399,14 +399,14 @@ class _ARNSRepository implements ARNSRepository {

@override
Future<PrimaryNameDetails> getPrimaryName(String address,
{bool update = false}) async {
{bool update = false, bool getLogo = true}) async {
logger.d('Getting primary name for address: $address');

if (!update && _cachedPrimaryName != null) {
return _cachedPrimaryName!;
}

final primaryName = await _sdk.getPrimaryNameDetails(address);
final primaryName = await _sdk.getPrimaryNameDetails(address, getLogo);

logger.d('Primary name: $primaryName');

Expand Down
63 changes: 42 additions & 21 deletions lib/authentication/components/login_modal.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:ardrive/authentication/components/breakpoint_layout_builder.dart';
import 'package:ardrive/gar/presentation/widgets/gar_modal.dart';
import 'package:ardrive_ui/ardrive_ui.dart';
import 'package:flutter/material.dart';

Expand All @@ -11,13 +12,15 @@ class ArDriveLoginModal extends StatelessWidget {
required this.content,
this.width,
this.hasCloseButton = true,
this.hasSettingsButton = false,
this.onClose,
this.padding,
});

final Widget content;
final double? width;
final bool hasCloseButton;
final bool hasSettingsButton;
final Function()? onClose;
final EdgeInsets? padding;

Expand All @@ -34,8 +37,8 @@ class ArDriveLoginModal extends StatelessWidget {
}

final contentPadding = (deviceWidth < TABLET)
? EdgeInsets.fromLTRB(22, hasCloseButton ? 0 : 44, 22, 32)
: EdgeInsets.fromLTRB(56, hasCloseButton ? 0 : 44, 56, 64);
? EdgeInsets.fromLTRB(22, hasCloseButton ? 0 : 24, 22, 32)
: EdgeInsets.fromLTRB(56, hasCloseButton ? 0 : 24, 56, 64);

return ConstrainedBox(
constraints: BoxConstraints(
Expand All @@ -57,27 +60,45 @@ class ArDriveLoginModal extends StatelessWidget {
child: Container(
color: colorTokens.containerRed,
)),
Row(children: [
const Spacer(),
if (hasCloseButton)
Padding(
padding: const EdgeInsets.all(22.0),
child: hasCloseButton
? ArDriveClickArea(
child: GestureDetector(
onTap: onClose ?? () => Navigator.pop(context),
child: const Align(
alignment: Alignment.centerRight,
child: ArDriveIcon(
icon: ArDriveIconsData.x,
size: 20,
Row(
children: [
const Spacer(),
if (hasCloseButton)
Padding(
padding: const EdgeInsets.all(22.0),
child: hasCloseButton
? ArDriveClickArea(
child: GestureDetector(
onTap: onClose ?? () => Navigator.pop(context),
child: const Align(
alignment: Alignment.centerRight,
child: ArDriveIcon(
icon: ArDriveIconsData.x,
size: 20,
),
),
),
),
)
: Container(),
)
]),
)
: Container(),
),
if (!hasCloseButton && hasSettingsButton)
Padding(
padding: const EdgeInsets.only(top: 22.0, right: 22.0),
child: GestureDetector(
onTap: () {
showGatewaySwitcherModal(context);
},
child: ArDriveClickArea(
tooltip: 'Advanced Settings',
child: Icon(
Icons.settings,
color: colorTokens.iconLow,
),
),
),
),
],
),
Padding(
padding: padding ?? contentPadding,
child: content,
Expand Down
Loading

0 comments on commit df630bd

Please sign in to comment.