Skip to content

Commit

Permalink
Adding Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbarry committed Dec 19, 2023
1 parent 2620ad6 commit 3ed90d5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 29 deletions.
16 changes: 9 additions & 7 deletions www/js/control/ProfileSettings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -393,13 +393,13 @@ const ProfileSettings = () => {
statusBarHeight={0}
elevated={true}
style={{ height: 46, backgroundColor: 'white', elevation: 3 }}
accessibilityRole='navigation'>
accessibilityRole="navigation">
<Appbar.Content title={t('control.profile-tab')} />
<TouchableOpacity style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-end' }}
<TouchableOpacity
style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-end' }}
// onPress={() => setLogoutVis(true)}
// accessibilityLabel={`${t('control.log-out')}`}
aria-labelledby='logout-group'
>
aria-labelledby="logout-group">
{/* <Text accessible={true}>{t('control.log-out')}
</Text>
<IconButton
Expand All @@ -408,11 +408,13 @@ const ProfileSettings = () => {
accessibilityLabel=''
accessibilityRole='button'
/> */}
<Text id='logout-group' accessible={true}>{t('control.log-out')}</Text>
<Text id="logout-group" accessible={true}>
{t('control.log-out')}
</Text>
<IconButton
icon='logout'
icon="logout"
// accessibilityLabel={t('control.log-out')}
accessibilityRole='button'
accessibilityRole="button"
/>
</TouchableOpacity>
</Appbar.Header>
Expand Down
18 changes: 3 additions & 15 deletions www/js/control/SettingRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { StyleSheet } from 'react-native';
import { List, Switch, useTheme } from 'react-native-paper';
import { useTranslation } from 'react-i18next';


const SettingRow = ({
textKey,
iconName = undefined,
Expand All @@ -15,23 +14,15 @@ const SettingRow = ({
const { t } = useTranslation(); // Access translations
const { colors } = useTheme(); // Get theme colors


let rightComponent;
if (iconName) {
rightComponent = (
<List.Icon
icon={iconName}
accessibilityLabel={iconName}
/>
);
rightComponent = <List.Icon icon={iconName} accessibilityLabel={iconName} />;
} else {
rightComponent = (
<Switch
value={switchValue}
accessibilityLabel={t(textKey)}
accessibilityHint={
switchValue ? t('Currently enabled') : t('Currently disabled')
}
accessibilityHint={switchValue ? t('Currently enabled') : t('Currently disabled')}
/>
);
}
Expand All @@ -42,7 +33,6 @@ const SettingRow = ({
descriptionText = '';
}


return (
<List.Item
style={styles.item(colors.surface)}
Expand All @@ -51,15 +41,14 @@ const SettingRow = ({
description={descriptionText}
descriptionStyle={descStyle ? descStyle : styles.description}
descriptionNumberOfLines={4}
accessibilityLabel={t(textKey)}
accessibilityLabel={t(textKey)}
accessibilityRole="button"
onPress={(e) => action(e)}
right={() => rightComponent}
/>
);
};


export const styles = StyleSheet.create({
item: (surfaceColor) => ({
justifyContent: 'space-between',
Expand All @@ -76,5 +65,4 @@ export const styles = StyleSheet.create({
},
});


export default SettingRow;
14 changes: 7 additions & 7 deletions www/js/onboarding/WelcomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const WelcomePage = () => {
<Surface style={[onboardingStyles.page, { paddingVertical: 0 }]}>
<View style={s.headerArea(windowWidth, colors)} aria-hidden={true} />
<IconButton
accessibilityLabel="More info"
accessibilityLabel="More info"
icon="information-variant"
containerColor={colors.onPrimary}
iconColor={colors.primary}
Expand All @@ -127,18 +127,18 @@ const WelcomePage = () => {
<View style={s.buttonsSection}>
<View style={{ width: windowWidth / 2 - 5, paddingHorizontal: 10, gap: 8 }}>
<View accessibilityRole="button">
<WelcomePageButton onPress={scanCode} icon="qrcode">
{t('join.scan-code')}
</WelcomePageButton>
<WelcomePageButton onPress={scanCode} icon="qrcode">
{t('join.scan-code')}
</WelcomePageButton>
</View>
<Text style={{ textAlign: 'center', margin: 'auto' }}>{t('join.scan-hint')}</Text>
</View>
<Divider style={{ width: 2, height: '100%' }} />
<View style={{ width: windowWidth / 2 - 5, paddingHorizontal: 10, gap: 8 }}>
<View accessibilityRole="button">
<WelcomePageButton onPress={() => setPasteModalVis(true)} icon="content-paste">
{t('join.paste-code')}
</WelcomePageButton>
<WelcomePageButton onPress={() => setPasteModalVis(true)} icon="content-paste">
{t('join.paste-code')}
</WelcomePageButton>
</View>
<Text style={{ textAlign: 'center', margin: 'auto' }}>{t('join.paste-hint')}</Text>
</View>
Expand Down

0 comments on commit 3ed90d5

Please sign in to comment.