Skip to content

Commit

Permalink
fix loading and error states
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmed Hussein committed Jul 4, 2024
1 parent 7e82200 commit 41bbabb
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/components/Navbar/SettingsDrawer/WordByWordSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Section from './Section';
import styles from './WordByWordSection.module.scss';

import DataFetcher from '@/components/DataFetcher';
import Error from '@/components/Error';
import Counter from '@/dls/Counter/Counter';
import Checkbox from '@/dls/Forms/Checkbox/Checkbox';
import Select, { SelectSize } from '@/dls/Forms/Select';
Expand Down Expand Up @@ -214,6 +215,7 @@ const WordByWordSection = () => {
</Section.Row>
<Separator className={styles.separator} />
<Section.Row>
<Section.Label>{t('trans-lang')}</Section.Label>
<DataFetcher
queryKey={makeWordByWordTranslationsUrl(lang)}
render={(data: WordByWordTranslationsResponse) => {
Expand All @@ -225,18 +227,15 @@ const WordByWordSection = () => {
}));

return (
<>
<Section.Label>{t('trans-lang')}</Section.Label>
<Select
size={SelectSize.Small}
id="wordByWord"
name="wordByWord"
options={options}
value={wordByWordLocale}
disabled={shouldDisableLanguageSelect}
onChange={onWordByWordLocaleChange}
/>
</>
<Select
size={SelectSize.Small}
id="wordByWord"
name="wordByWord"
options={options}
value={wordByWordLocale}
disabled={shouldDisableLanguageSelect}
onChange={onWordByWordLocaleChange}
/>
);
}}
/>
Expand Down

0 comments on commit 41bbabb

Please sign in to comment.