Skip to content

Commit

Permalink
Use flairup in PickerMain.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
ealush committed Jan 4, 2024
1 parent 712a4cf commit 4217c63
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 21 deletions.
5 changes: 0 additions & 5 deletions src/components/body/EmojiList.css

This file was deleted.

15 changes: 12 additions & 3 deletions src/components/body/EmojiList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { cx } from 'flairup';
import * as React from 'react';

import { ClassNames } from '../../DomUtils/classNames';
import { stylesheet } from '../../Stylesheet/stylesheet';
import {
Categories,
CategoryConfig,
Expand All @@ -25,14 +27,12 @@ import { ClickableEmoji } from '../emoji/Emoji';
import { EmojiCategory } from './EmojiCategory';
import { Suggested } from './Suggested';

import './EmojiList.css';

export function EmojiList() {
const categories = useCategoriesConfig();
const renderdCategoriesCountRef = React.useRef(0);

return (
<ul className={ClassNames.emojiList}>
<ul className={cx(styles.emojiList)}>
{categories.map(categoryConfig => {
const category = categoryFromCategoryConfig(categoryConfig);

Expand Down Expand Up @@ -124,3 +124,12 @@ function RenderCategory({
</EmojiCategory>
);
}

const styles = stylesheet.create({
emojiList: {
'.': ClassNames.emojiList,
listStyle: 'none',
margin: 0,
padding: 0
}
});
9 changes: 0 additions & 9 deletions src/components/main/PickerMain.css

This file was deleted.

19 changes: 15 additions & 4 deletions src/components/main/PickerMain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { cx } from 'flairup';
import * as React from 'react';

import { ClassNames } from '../../DomUtils/classNames';
import { stylesheet } from '../../Stylesheet/stylesheet';
import {
useClassNameConfig,
useStyleConfig,
Expand All @@ -14,8 +15,6 @@ import { Theme } from '../../types/exposedTypes';
import { usePickerMainRef } from '../context/ElementRefContext';
import { PickerContextProvider } from '../context/PickerContext';

import './PickerMain.css';

type Props = Readonly<{
children: React.ReactNode;
}>;
Expand Down Expand Up @@ -47,8 +46,7 @@ function PickerRootElement({ children }: RootProps) {
return (
<aside
className={cx(
ClassNames.emojiPicker,
'epr-main',
styles.main,
{
[ClassNames.searchActive]: searchModeActive,
[ClassNames.darkTheme]: theme === Theme.DARK,
Expand All @@ -63,3 +61,16 @@ function PickerRootElement({ children }: RootProps) {
</aside>
);
}

const styles = stylesheet.create({
main: {
'.': ['epr-main', ClassNames.emojiPicker],
position: 'relative',
display: 'flex',
flexDirection: 'column',
borderWidth: '1px',
borderStyle: 'solid',
borderRadius: 'var(--epr-picker-border-radius)',
borderColor: 'var(--epr-picker-border-color)'
}
});

0 comments on commit 4217c63

Please sign in to comment.