Skip to content

Commit

Permalink
chore: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexogamer committed Feb 3, 2025
1 parent 73a884f commit f80c76b
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 73 deletions.
23 changes: 10 additions & 13 deletions src/MainView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ import {
handleMessageNotification,
setUpNotifeeListener,
} from '@clerotri/lib/notifications';
import {
ChannelContext,
OrderedServersContext,
} from '@clerotri/lib/state';
import {ChannelContext, OrderedServersContext} from '@clerotri/lib/state';
import {storage} from '@clerotri/lib/storage';
import {ThemeContext} from '@clerotri/lib/themes';
import {CVChannel} from '@clerotri/lib/types';
Expand Down Expand Up @@ -155,15 +152,15 @@ function LoggedInViews({

return (
<ChannelContext.Provider value={{currentChannel, setCurrentChannel}}>
<SideMenuHandler />
<Modals />
<NetworkIndicator client={client} />
<View style={{position: 'absolute', top: 20, left: 0, width: '100%'}}>
<Notification
message={notificationMessage}
dismiss={() => setNotificationMessage(null)}
/>
</View>
<SideMenuHandler />
<Modals />
<NetworkIndicator client={client} />
<View style={{position: 'absolute', top: 20, left: 0, width: '100%'}}>
<Notification
message={notificationMessage}
dismiss={() => setNotificationMessage(null)}
/>
</View>
</ChannelContext.Provider>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/messaging/Emoji.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {useState} from 'react';
import {StyleSheet} from 'react-native';

import { SVGEmoji } from './SVGEmoji';
import {SVGEmoji} from './SVGEmoji';
import {Image} from '@clerotri/crossplat/Image';
import {app} from '@clerotri/Generic';
import {client} from '@clerotri/lib/client';
Expand Down
60 changes: 29 additions & 31 deletions src/components/common/messaging/SVGEmoji.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,34 @@ import {RevoltEmojiDictionary} from '@clerotri/lib/consts';
import {EmojiPacks} from '@clerotri/lib/types';
import {unicodeEmojiURL} from '@clerotri/lib/utils';


export const SVGEmoji = ({id, pack}: {id: string; pack: EmojiPacks}) => {
const [error, setError] = useState(false);
if (error) {
return <Text>{`:${id}:`}</Text>;
}
if (Object.hasOwn(RevoltEmojiDictionary, id)) {
id = RevoltEmojiDictionary[id];
}
return (
<SvgUri
width={localStyles.emoji.width}
height={localStyles.emoji.height}
style={localStyles.emoji}
uri={unicodeEmojiURL(id, pack)}
onError={() => setError(true)}
fallback={<Text>{`:${id}:`}</Text>}
/>
);
};

const [error, setError] = useState(false);
if (error) {
return <Text>{`:${id}:`}</Text>;
}
if (Object.hasOwn(RevoltEmojiDictionary, id)) {
id = RevoltEmojiDictionary[id];
}
return (
<SvgUri
width={localStyles.emoji.width}
height={localStyles.emoji.height}
style={localStyles.emoji}
uri={unicodeEmojiURL(id, pack)}
onError={() => setError(true)}
fallback={<Text>{`:${id}:`}</Text>}
/>
);
};

const localStyles = StyleSheet.create({
emoji: {
objectFit: 'contain',
height: 14,
width: 14,
marginRight: 5,
marginLeft: 1,
// display: 'block',
position: 'absolute',
},
});
const localStyles = StyleSheet.create({
emoji: {
objectFit: 'contain',
height: 14,
width: 14,
marginRight: 5,
marginLeft: 1,
// display: 'block',
position: 'absolute',
},
});
50 changes: 23 additions & 27 deletions src/components/common/messaging/SVGEmoji.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@ import {RevoltEmojiDictionary} from '@clerotri/lib/consts';
import {EmojiPacks} from '@clerotri/lib/types';
import {unicodeEmojiURL} from '@clerotri/lib/utils';


export const SVGEmoji = ({id, pack}: {id: string; pack: EmojiPacks}) => {
const [error, setError] = useState(false);
if (error) {
return <Text>{`:${id}:`}</Text>;
}
if (Object.hasOwn(RevoltEmojiDictionary, id)) {
id = RevoltEmojiDictionary[id];
}
return (
<svg width={localStyles.emoji.width}
height={localStyles.emoji.height}
>
const [error, setError] = useState(false);
if (error) {
return <Text>{`:${id}:`}</Text>;
}
if (Object.hasOwn(RevoltEmojiDictionary, id)) {
id = RevoltEmojiDictionary[id];
}
return (
<svg width={localStyles.emoji.width} height={localStyles.emoji.height}>
<image
width={localStyles.emoji.width}
height={localStyles.emoji.height}
Expand All @@ -27,19 +24,18 @@ export const SVGEmoji = ({id, pack}: {id: string; pack: EmojiPacks}) => {
onError={() => setError(true)}
// fallback={<Text>{`:${id}:`}</Text>}
/>
</svg>
);
};

</svg>
);
};

const localStyles = StyleSheet.create({
emoji: {
objectFit: 'contain',
height: 14,
width: 14,
marginRight: 5,
marginLeft: 1,
// display: 'block',
position: 'absolute',
},
});
const localStyles = StyleSheet.create({
emoji: {
objectFit: 'contain',
height: 14,
width: 14,
marginRight: 5,
marginLeft: 1,
// display: 'block',
position: 'absolute',
},
});
2 changes: 1 addition & 1 deletion src/lib/utils/nativeUtils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Platform, ToastAndroid} from 'react-native';

import { DOMParser as CoreDOMParser } from '@xmldom/xmldom';
import {DOMParser as CoreDOMParser} from '@xmldom/xmldom';

export function showToast(badgeName: string) {
if (Platform.OS === 'android') {
Expand Down

0 comments on commit f80c76b

Please sign in to comment.