Skip to content

Commit 5ea7a7d

Browse files
committed
Bring back the new post button
1 parent e7702bf commit 5ea7a7d

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

apps/polycentric/src/common/components/layout/Layout.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
2525
import WEB_LOGO from '../../assets/images/WebLogo.png';
2626
import { VerticalNav } from './nav/VerticalNav';
2727
import { Ionicons } from '@expo/vector-icons';
28-
import { FUTO_URL } from '../../constants';
28+
import { FUTO_URL, openCompose } from '../../constants';
29+
import { Button } from '../primitives';
2930

3031
type MainProps = {
3132
children: ReactElement | ReactElement[];
@@ -161,7 +162,7 @@ export const LeftSidebar = memo(function LeftSidebar({
161162
Atoms.align_center,
162163
Atoms.h_full,
163164
{
164-
paddingHorizontal: narrowSidebar ? 0 : 60,
165+
paddingHorizontal: narrowSidebar ? 0 : 30,
165166
width: narrowSidebar ? 88 : 275,
166167
},
167168
]}
@@ -188,6 +189,18 @@ export const LeftSidebar = memo(function LeftSidebar({
188189
<VerticalNav />
189190
</View>
190191
{/* 2nd Section (bottom) */}
192+
<View style={[Atoms.py_md, Atoms.self_stretch]}>
193+
<Button
194+
title="New Post"
195+
variant="primary"
196+
size="md"
197+
fullWidth
198+
icon={({ size, color }) => (
199+
<Ionicons name="add-circle" size={size} color={color} />
200+
)}
201+
onPress={() => openCompose()}
202+
/>
203+
</View>
191204
</View>
192205
</View>
193206
</View>

apps/polycentric/src/common/components/primitives/Button.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { usePressAnimation } from '@/src/common/lib/animation';
22
import { useWebHover } from '@/src/common/lib/useWebHover';
33
import {
4+
Atoms,
45
BorderRadius,
56
useTheme,
67
withHexOpacity,
@@ -51,9 +52,9 @@ const SIZE_CONFIG: Record<
5152
borderRadius: BorderRadiusToken;
5253
}
5354
> = {
54-
sm: { paddingV: 4, paddingH: 6, iconSize: 16, borderRadius: 'sm' },
55-
md: { paddingV: 12, paddingH: 18, iconSize: 20, borderRadius: 'lg' },
56-
lg: { paddingV: 18, paddingH: 24, iconSize: 24, borderRadius: 'lg' },
55+
sm: { paddingV: 4, paddingH: 6, iconSize: 16, borderRadius: 'full' },
56+
md: { paddingV: 12, paddingH: 18, iconSize: 20, borderRadius: 'full' },
57+
lg: { paddingV: 18, paddingH: 24, iconSize: 24, borderRadius: 'full' },
5758
};
5859

5960
export function Button({
@@ -95,6 +96,7 @@ export function Button({
9596
hitSlop={8}
9697
style={[
9798
styles.base,
99+
fullWidth && Atoms.w_full,
98100
!fullWidth && styles.fitContent,
99101
{
100102
paddingVertical: sizeConfig.paddingV,

0 commit comments

Comments
 (0)