Skip to content

Commit

Permalink
Upgrade React Navigation + Brutalist UI refresh (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
duogenesis authored Dec 22, 2024
1 parent 0943fdf commit 4e876af
Show file tree
Hide file tree
Showing 26 changed files with 299 additions and 303 deletions.
2 changes: 1 addition & 1 deletion App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const HomeTabs = () => {
return (
<Tab.Navigator
backBehavior="history"
screenOptions={{ headerShown: false }}
screenOptions={{ headerShown: false, animation: 'shift' }}
tabBar={props => <TabBar {...props} />}
>
<Tab.Screen name="Q&A" component={QuizTab} />
Expand Down
2 changes: 1 addition & 1 deletion components/audio-bio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ const AudioBio = ({
width: '100%',
borderRadius: 10,
borderWidth: 1,
borderColor: '#ccc',
borderColor: '#999',
padding: 10,
gap: 15,
}}
Expand Down
64 changes: 21 additions & 43 deletions components/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@ const Avatar = ({percentage, ...props}) => {
verificationRequired = null,
} = props;

const shadowStyle = (shadow && !isSkipped && !verificationRequired) ? {
shadowOffset: {
width: 0,
height: 2,
},
shadowOpacity: 0.3,
shadowRadius: 6,
elevation: 6,
} : {};

const Element = navigation ? Pressable : View;
const elementStyle = useRef({
height: 90,
Expand Down Expand Up @@ -70,44 +60,32 @@ const Avatar = ({percentage, ...props}) => {
onPress={onPress}
style={elementStyle}
>
<View
<ImageBackground
source={imageUuid && {
uri: `${IMAGES_URL}/450-${imageUuid}.jpg`,
height: 450,
width: 450,
}}
placeholder={imageBlurhash && { blurhash: imageBlurhash }}
transition={150}
style={{
flex: 1,
aspectRatio: 1,
borderRadius: 999,
margin: 2,
borderColor: 'white',
backgroundColor: imageUuid ? 'white' : '#f1e5ff',
borderWidth: 2,
overflow: 'visible',
...shadowStyle,

overflow: 'hidden',
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#f1e5ff',
margin: 4,
}}
>
<ImageBackground
source={imageUuid && {
uri: `${IMAGES_URL}/450-${imageUuid}.jpg`,
height: 450,
width: 450,
}}
placeholder={imageBlurhash && { blurhash: imageBlurhash }}
transition={150}
style={{
flex: 1,
aspectRatio: 1,
borderRadius: 999,
overflow: 'hidden',
justifyContent: 'center',
alignItems: 'center',
}}
>
{!imageUuid &&
<Ionicons
style={{fontSize: 40, color: 'rgba(119, 0, 255, 0.2)'}}
name={'person'}
/>
}
</ImageBackground>
</View>
{!imageUuid &&
<Ionicons
style={{fontSize: 40, color: 'rgba(119, 0, 255, 0.2)'}}
name={'person'}
/>
}
</ImageBackground>
<View
style={{
position: 'absolute',
Expand Down
2 changes: 1 addition & 1 deletion components/basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Basic = ({children, ...rest}) => {
<Animated.View
style={[
{
borderColor: 'rgba(0, 0, 0, 0.1)',
borderColor: 'rgba(0, 0, 0, 0.4)',
borderWidth: 1,
borderRadius: 999,
justifyContent: 'center',
Expand Down
4 changes: 3 additions & 1 deletion components/button-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ const ButtonGroup = (props) => {
selectedButtonStyle={{
backgroundColor: 'rgb(228, 204, 255)', // = #70f, 0.2 opacity
borderRadius: secondary === true ? secondaryBorderRadius : borderRadius,
borderWidth: 1,
borderBottomWidth: 3,
borderColor: '#70f',
}}
selectedTextStyle={{
color: '#70f',
Expand All @@ -45,7 +48,6 @@ const ButtonGroup = (props) => {
marginBottom: 10,
borderWidth: 0,
overflow: 'visible',
backgroundColor: 'rgb(245, 245, 245)',
borderRadius: secondary === true ? secondaryBorderRadius : borderRadius,
height: 48,
...(secondary === true ? secondaryContainerStyle : {}),
Expand Down
2 changes: 1 addition & 1 deletion components/button/centered-text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const ButtonWithCenteredText = (props) => {
containerStyle?.height === undefined
) ? undefined : '100%',
borderRadius: 999,
borderColor: borderColor === undefined ? '#ccc' : borderColor,
borderColor: borderColor === undefined ? 'black' : borderColor,
borderWidth: borderWidth === undefined ? (secondary ? 1 : 0) : borderWidth,
backgroundColor: backgroundColor || (secondary ? 'white' : '#70f'),
opacity: animatedOpacity,
Expand Down
3 changes: 2 additions & 1 deletion components/button/option.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ const ButtonForOption = (props) => {
style={{
width: '100%',
height: '100%',
borderColor: '#aaa',
borderColor: '#999',
borderWidth: 1,
borderBottomWidth: 2,
borderRadius: 999,
paddingLeft: 10,
paddingRight: 20,
Expand Down
24 changes: 16 additions & 8 deletions components/chart.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
Animated,
DimensionValue,
LayoutAnimation,
Pressable,
View,
Expand Down Expand Up @@ -83,7 +84,11 @@ const Chart = ({name1, percentage1, name2, percentage2, ...props}) => {
const position_ = position && Math.round(position);
const extraHeight_ = extraHeight || 0;

const labelPosition = position_ < 50 ?
const labelPosition: {
left: DimensionValue
} | {
right: DimensionValue
} = position_ < 50 ?
{left: `${position_}%`} :
{right: `${100 - position_}%`};

Expand Down Expand Up @@ -185,14 +190,17 @@ const Chart = ({name1, percentage1, name2, percentage2, ...props}) => {
borderRadius: 5,
marginTop: 10,
marginBottom: 10,
shadowOffset: {
width: 0,
height: 2,
},
shadowOpacity: 0.2,
shadowRadius: 3,
elevation: 8,
overflow: 'visible',

borderTopWidth: 1,
borderLeftWidth: 1,
borderRightWidth: 1,
borderBottomWidth: 3,

borderTopColor: '#eee',
borderLeftColor: '#eee',
borderRightColor: '#eee',
borderBottomColor: '#ddd',
}}
>
<Pressable
Expand Down
6 changes: 4 additions & 2 deletions components/check-chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ const CheckChip = ({label, ...props}) => {
<Pressable
style={{
borderRadius: 999,
borderWidth: 3,
borderColor: 'white',
borderWidth: 1,
borderRightWidth: 2,
borderBottomWidth: 4,
borderColor: 'black',
paddingLeft: 20,
paddingRight: 20,
paddingTop: 12,
Expand Down
6 changes: 5 additions & 1 deletion components/club-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const SelectedClub = ({
style={{
backgroundColor: 'rgba(119, 0, 255, 0.1)',
flexShrink: 1,
borderBottomWidth: 3,
}}
textStyle={{
color: '#70f',
Expand Down Expand Up @@ -110,8 +111,11 @@ const UnselectedClub = ({
marginBottom: 5,
flexWrap: 'wrap',
flexShrink: 1,
borderBottomWidth: 3,
}}
>{clubItem.name}</Basic>
>
{clubItem.name}
</Basic>
<DefaultText style={{fontWeight: '700'}}>
{clubItem.count_members}
{' '}
Expand Down
5 changes: 4 additions & 1 deletion components/club.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ const Club = ({
return (
<Basic
onPress={onPress}
style={style}
style={{
borderBottomWidth: 3,
...style
}}
textStyle={{
fontFamily: isMutual ? 'TruenoBold' : 'Trueno',
fontWeight: isMutual ? '900' : '400',
Expand Down
Loading

0 comments on commit 4e876af

Please sign in to comment.