Skip to content

Commit

Permalink
refactor: bring in emoji code, typing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexogamer committed Jun 24, 2024
1 parent 85389bc commit 7015d28
Show file tree
Hide file tree
Showing 6 changed files with 1,916 additions and 37 deletions.
7 changes: 4 additions & 3 deletions src/components/common/messaging/Emoji.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import {useState} from 'react';

import {SvgUri} from 'react-native-svg';

import {EmojiPacks, RevoltEmojiDictionary, unicodeEmojiURL} from 'revkit';

import {Image} from '@rvmob/crossplat/Image';
import {client, app} from '@rvmob/Generic';
import {styles} from '@rvmob/Theme';
Expand All @@ -12,7 +10,10 @@ import {
RE_CUSTOM_EMOJI,
RE_DEFAULT_EMOJI,
RE_UNICODE_EMOJI,
} from '../../../lib/consts';
RevoltEmojiDictionary,
} from '@rvmob/lib/consts';
import {EmojiPacks} from '@rvmob/lib/types';
import {unicodeEmojiURL} from '@rvmob/lib/utils';

const SvgEmoji = ({id, pack}: {id: string; pack: EmojiPacks}) => {
const [error, setError] = useState(false);
Expand Down
25 changes: 7 additions & 18 deletions src/components/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,24 @@ export const HomePage = observer(() => {
const date = `${rawDate.getDate()}/${rawMonth}`;
const month = `month${rawMonth}`;

// @ts-expect-error hmmmm
let holidayEmoji = SPECIAL_DATES.includes(date) ? (
<TouchableOpacity
onPress={() => {
// @ts-expect-error TODO: figure out types for this
openUrl(SPECIAL_DATE_OBJECTS[date].link);
}}>
<Text
// @ts-expect-error as above
key={SPECIAL_DATE_OBJECTS[date].key}
style={{fontSize: 40}}>
{
// @ts-expect-error as above
SPECIAL_DATE_OBJECTS[date].emoji
}
<Text key={SPECIAL_DATE_OBJECTS[date].key} style={{fontSize: 40}}>
{SPECIAL_DATE_OBJECTS[date].emoji}
</Text>
</TouchableOpacity>
) : SPECIAL_DATES.includes(month) ? (
) : // @ts-expect-error hmmmm
SPECIAL_DATES.includes(month) ? (
<TouchableOpacity
onPress={() => {
// @ts-expect-error as above
openUrl(SPECIAL_DATE_OBJECTS[month].link);
}}>
<Text // @ts-expect-error as above
key={SPECIAL_DATE_OBJECTS[month].key}
style={{fontSize: 40}}>
{
// @ts-expect-error as above
SPECIAL_DATE_OBJECTS[month].emoji
}
<Text key={SPECIAL_DATE_OBJECTS[month].key} style={{fontSize: 40}}>
{SPECIAL_DATE_OBJECTS[month].emoji}
</Text>
</TouchableOpacity>
) : null;
Expand Down
Loading

0 comments on commit 7015d28

Please sign in to comment.