Skip to content

Commit 563956d

Browse files
authored
chore: update space view buttons design (#2126)
1 parent c204f48 commit 563956d

File tree

2 files changed

+26
-50
lines changed

2 files changed

+26
-50
lines changed

assets/l10n/intl_en.arb

+2-1
Original file line numberDiff line numberDiff line change
@@ -4811,5 +4811,6 @@
48114811
"inviteAndLaunch": "Invite and launch",
48124812
"createOwnChat": "Create your own chat",
48134813
"pleaseEnterInt": "Please enter a number",
4814-
"home": "Home"
4814+
"home": "Home",
4815+
"join": "Join"
48154816
}

lib/pangea/spaces/widgets/space_filter_buttons.dart

+24-49
Original file line numberDiff line numberDiff line change
@@ -10,69 +10,44 @@ class SpaceFilterButtons extends StatelessWidget {
1010

1111
@override
1212
Widget build(BuildContext context) {
13-
final theme = Theme.of(context);
1413
return SliverList(
1514
delegate: SliverChildListDelegate(
1615
[
1716
const SizedBox(height: 16.0),
1817
Padding(
19-
padding: const EdgeInsets.symmetric(
20-
horizontal: 8.0,
21-
vertical: 4.0,
22-
),
23-
child: ElevatedButton(
24-
style: ElevatedButton.styleFrom(
25-
backgroundColor: theme.colorScheme.primary,
26-
padding: const EdgeInsets.all(0),
27-
),
28-
onPressed: () => SpaceCodeUtil.joinWithSpaceCodeDialog(context),
29-
child: Row(
30-
spacing: 16.0,
31-
mainAxisAlignment: MainAxisAlignment.center,
32-
children: [
33-
Icon(
34-
Icons.join_right_outlined,
35-
color: theme.colorScheme.onPrimary,
18+
padding: const EdgeInsets.all(4.0),
19+
child: Center(
20+
child: SizedBox(
21+
width: 100.0,
22+
child: FloatingActionButton.extended(
23+
onPressed: () =>
24+
SpaceCodeUtil.joinWithSpaceCodeDialog(context),
25+
icon: const Icon(Icons.join_right_outlined),
26+
label: Text(
27+
L10n.of(context).join,
28+
overflow: TextOverflow.fade,
3629
),
37-
Text(
38-
L10n.of(context).joinByCode,
39-
style: theme.textTheme.bodyMedium?.copyWith(
40-
color: theme.colorScheme.onPrimary,
41-
),
42-
),
43-
],
30+
),
4431
),
4532
),
4633
),
4734
Padding(
48-
padding: const EdgeInsets.symmetric(
49-
horizontal: 8.0,
50-
vertical: 2.0,
51-
),
52-
child: ElevatedButton(
53-
style: ElevatedButton.styleFrom(
54-
backgroundColor: theme.colorScheme.primary,
55-
padding: const EdgeInsets.all(0),
56-
),
57-
onPressed: () => context.go('/rooms/newspace'),
58-
child: Row(
59-
spacing: 16.0,
60-
mainAxisAlignment: MainAxisAlignment.center,
61-
children: [
62-
Icon(
63-
Icons.add,
64-
color: theme.colorScheme.onPrimary,
65-
),
66-
Text(
67-
L10n.of(context).createASpace,
68-
style: theme.textTheme.bodyMedium?.copyWith(
69-
color: theme.colorScheme.onPrimary,
70-
),
35+
padding: const EdgeInsets.all(4.0),
36+
child: Center(
37+
child: SizedBox(
38+
width: 100.0,
39+
child: FloatingActionButton.extended(
40+
onPressed: () => context.go('/rooms/newspace'),
41+
icon: const Icon(Icons.add),
42+
label: Text(
43+
L10n.of(context).space,
44+
overflow: TextOverflow.fade,
7145
),
72-
],
46+
),
7347
),
7448
),
7549
),
50+
const SizedBox(height: 16.0),
7651
],
7752
),
7853
);

0 commit comments

Comments
 (0)