Skip to content

Commit

Permalink
i18n: sync page
Browse files Browse the repository at this point in the history
  • Loading branch information
rockbenben committed Sep 5, 2024
1 parent 9a3dcd1 commit 9ec6088
Show file tree
Hide file tree
Showing 12 changed files with 252 additions and 60 deletions.
26 changes: 21 additions & 5 deletions i18n/ar/docusaurus-plugin-content-pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function ShowcaseFilters({ onToggleDescription, showUserFavs, setShowUserFavs })
<ul className={clsx("clean-list", styles.checkboxList)}>
{userAuth && (
<>
<li className={styles.checkboxListItem} onClick={handleUserPrompts}>
<li className={`${styles.checkboxListItem} ${showUserPrompts ? styles.activeItem : ""}`} onClick={handleUserPrompts}>
<ShowcaseTooltip
text={translate({
id: "myprompt.tooltip",
Expand All @@ -206,7 +206,7 @@ function ShowcaseFilters({ onToggleDescription, showUserFavs, setShowUserFavs })
/>
</ShowcaseTooltip>
</li>
<li className={styles.checkboxListItem} onClick={handleUserFavs}>
<li className={`${styles.checkboxListItem} ${showUserFavs ? styles.activeItem : ""}`} onClick={handleUserFavs}>
<ShowcaseTooltip
text={translate({
id: "myfavorite.tooltip",
Expand Down Expand Up @@ -296,13 +296,27 @@ function ShowcaseFilters({ onToggleDescription, showUserFavs, setShowUserFavs })
</ShowcaseTooltip>
</li>
</ul>
{showUserPrompts && <UserPrompts />}
{showUserFavs && <UserFavorite />}
{showUserPrompts && (
<>
<div className={clsx("margin-bottom--md", styles.showcaseFavoriteHeader)}>
<SearchBar setShowUserPrompts={setShowUserPrompts} setShowUserFavs={setShowUserFavs} />
</div>
<UserPrompts />
</>
)}
{showUserFavs && (
<>
<div className={clsx("margin-bottom--md", styles.showcaseFavoriteHeader)}>
<SearchBar setShowUserPrompts={setShowUserPrompts} setShowUserFavs={setShowUserFavs} />
</div>
<UserFavorite />
</>
)}
</section>
);
}

function SearchBar() {
function SearchBar({ setShowUserPrompts = (value) => {}, setShowUserFavs = (value) => {} }) {
const history = useHistory();
const location = useLocation();
const searchRef = useRef(null);
Expand All @@ -323,6 +337,8 @@ function SearchBar() {
search: newSearch.toString(),
state: prepareUserState(),
});
setShowUserPrompts(false);
setShowUserFavs(false);
}, [value, location, history]);

useEffect(() => {
Expand Down
26 changes: 21 additions & 5 deletions i18n/bn/docusaurus-plugin-content-pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function ShowcaseFilters({ onToggleDescription, showUserFavs, setShowUserFavs })
<ul className={clsx("clean-list", styles.checkboxList)}>
{userAuth && (
<>
<li className={styles.checkboxListItem} onClick={handleUserPrompts}>
<li className={`${styles.checkboxListItem} ${showUserPrompts ? styles.activeItem : ""}`} onClick={handleUserPrompts}>
<ShowcaseTooltip
text={translate({
id: "myprompt.tooltip",
Expand All @@ -206,7 +206,7 @@ function ShowcaseFilters({ onToggleDescription, showUserFavs, setShowUserFavs })
/>
</ShowcaseTooltip>
</li>
<li className={styles.checkboxListItem} onClick={handleUserFavs}>
<li className={`${styles.checkboxListItem} ${showUserFavs ? styles.activeItem : ""}`} onClick={handleUserFavs}>
<ShowcaseTooltip
text={translate({
id: "myfavorite.tooltip",
Expand Down Expand Up @@ -296,13 +296,27 @@ function ShowcaseFilters({ onToggleDescription, showUserFavs, setShowUserFavs })
</ShowcaseTooltip>
</li>
</ul>
{showUserPrompts && <UserPrompts />}
{showUserFavs && <UserFavorite />}
{showUserPrompts && (
<>
<div className={clsx("margin-bottom--md", styles.showcaseFavoriteHeader)}>
<SearchBar setShowUserPrompts={setShowUserPrompts} setShowUserFavs={setShowUserFavs} />
</div>
<UserPrompts />
</>
)}
{showUserFavs && (
<>
<div className={clsx("margin-bottom--md", styles.showcaseFavoriteHeader)}>
<SearchBar setShowUserPrompts={setShowUserPrompts} setShowUserFavs={setShowUserFavs} />
</div>
<UserFavorite />
</>
)}
</section>
);
}

function SearchBar() {
function SearchBar({ setShowUserPrompts = (value) => {}, setShowUserFavs = (value) => {} }) {
const history = useHistory();
const location = useLocation();
const searchRef = useRef(null);
Expand All @@ -323,6 +337,8 @@ function SearchBar() {
search: newSearch.toString(),
state: prepareUserState(),
});
setShowUserPrompts(false);
setShowUserFavs(false);
}, [value, location, history]);

useEffect(() => {
Expand Down
26 changes: 21 additions & 5 deletions i18n/de/docusaurus-plugin-content-pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function ShowcaseFilters({ onToggleDescription, showUserFavs, setShowUserFavs })
<ul className={clsx("clean-list", styles.checkboxList)}>
{userAuth && (
<>
<li className={styles.checkboxListItem} onClick={handleUserPrompts}>
<li className={`${styles.checkboxListItem} ${showUserPrompts ? styles.activeItem : ""}`} onClick={handleUserPrompts}>
<ShowcaseTooltip
text={translate({
id: "myprompt.tooltip",
Expand All @@ -206,7 +206,7 @@ function ShowcaseFilters({ onToggleDescription, showUserFavs, setShowUserFavs })
/>
</ShowcaseTooltip>
</li>
<li className={styles.checkboxListItem} onClick={handleUserFavs}>
<li className={`${styles.checkboxListItem} ${showUserFavs ? styles.activeItem : ""}`} onClick={handleUserFavs}>
<ShowcaseTooltip
text={translate({
id: "myfavorite.tooltip",
Expand Down Expand Up @@ -296,13 +296,27 @@ function ShowcaseFilters({ onToggleDescription, showUserFavs, setShowUserFavs })
</ShowcaseTooltip>
</li>
</ul>
{showUserPrompts && <UserPrompts />}
{showUserFavs && <UserFavorite />}
{showUserPrompts && (
<>
<div className={clsx("margin-bottom--md", styles.showcaseFavoriteHeader)}>
<SearchBar setShowUserPrompts={setShowUserPrompts} setShowUserFavs={setShowUserFavs} />
</div>
<UserPrompts />
</>
)}
{showUserFavs && (
<>
<div className={clsx("margin-bottom--md", styles.showcaseFavoriteHeader)}>
<SearchBar setShowUserPrompts={setShowUserPrompts} setShowUserFavs={setShowUserFavs} />
</div>
<UserFavorite />
</>
)}
</section>
);
}

function SearchBar() {
function SearchBar({ setShowUserPrompts = (value) => {}, setShowUserFavs = (value) => {} }) {
const history = useHistory();
const location = useLocation();
const searchRef = useRef(null);
Expand All @@ -323,6 +337,8 @@ function SearchBar() {
search: newSearch.toString(),
state: prepareUserState(),
});
setShowUserPrompts(false);
setShowUserFavs(false);
}, [value, location, history]);

useEffect(() => {
Expand Down
26 changes: 21 additions & 5 deletions i18n/en/docusaurus-plugin-content-pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function ShowcaseFilters({ onToggleDescription, showUserFavs, setShowUserFavs })
<ul className={clsx("clean-list", styles.checkboxList)}>
{userAuth && (
<>
<li className={styles.checkboxListItem} onClick={handleUserPrompts}>
<li className={`${styles.checkboxListItem} ${showUserPrompts ? styles.activeItem : ""}`} onClick={handleUserPrompts}>
<ShowcaseTooltip
text={translate({
id: "myprompt.tooltip",
Expand All @@ -206,7 +206,7 @@ function ShowcaseFilters({ onToggleDescription, showUserFavs, setShowUserFavs })
/>
</ShowcaseTooltip>
</li>
<li className={styles.checkboxListItem} onClick={handleUserFavs}>
<li className={`${styles.checkboxListItem} ${showUserFavs ? styles.activeItem : ""}`} onClick={handleUserFavs}>
<ShowcaseTooltip
text={translate({
id: "myfavorite.tooltip",
Expand Down Expand Up @@ -296,13 +296,27 @@ function ShowcaseFilters({ onToggleDescription, showUserFavs, setShowUserFavs })
</ShowcaseTooltip>
</li>
</ul>
{showUserPrompts && <UserPrompts />}
{showUserFavs && <UserFavorite />}
{showUserPrompts && (
<>
<div className={clsx("margin-bottom--md", styles.showcaseFavoriteHeader)}>
<SearchBar setShowUserPrompts={setShowUserPrompts} setShowUserFavs={setShowUserFavs} />
</div>
<UserPrompts />
</>
)}
{showUserFavs && (
<>
<div className={clsx("margin-bottom--md", styles.showcaseFavoriteHeader)}>
<SearchBar setShowUserPrompts={setShowUserPrompts} setShowUserFavs={setShowUserFavs} />
</div>
<UserFavorite />
</>
)}
</section>
);
}

function SearchBar() {
function SearchBar({ setShowUserPrompts = (value) => {}, setShowUserFavs = (value) => {} }) {
const history = useHistory();
const location = useLocation();
const searchRef = useRef(null);
Expand All @@ -323,6 +337,8 @@ function SearchBar() {
search: newSearch.toString(),
state: prepareUserState(),
});
setShowUserPrompts(false);
setShowUserFavs(false);
}, [value, location, history]);

useEffect(() => {
Expand Down
26 changes: 21 additions & 5 deletions i18n/es/docusaurus-plugin-content-pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function ShowcaseFilters({ onToggleDescription, showUserFavs, setShowUserFavs })
<ul className={clsx("clean-list", styles.checkboxList)}>
{userAuth && (
<>
<li className={styles.checkboxListItem} onClick={handleUserPrompts}>
<li className={`${styles.checkboxListItem} ${showUserPrompts ? styles.activeItem : ""}`} onClick={handleUserPrompts}>
<ShowcaseTooltip
text={translate({
id: "myprompt.tooltip",
Expand All @@ -206,7 +206,7 @@ function ShowcaseFilters({ onToggleDescription, showUserFavs, setShowUserFavs })
/>
</ShowcaseTooltip>
</li>
<li className={styles.checkboxListItem} onClick={handleUserFavs}>
<li className={`${styles.checkboxListItem} ${showUserFavs ? styles.activeItem : ""}`} onClick={handleUserFavs}>
<ShowcaseTooltip
text={translate({
id: "myfavorite.tooltip",
Expand Down Expand Up @@ -296,13 +296,27 @@ function ShowcaseFilters({ onToggleDescription, showUserFavs, setShowUserFavs })
</ShowcaseTooltip>
</li>
</ul>
{showUserPrompts && <UserPrompts />}
{showUserFavs && <UserFavorite />}
{showUserPrompts && (
<>
<div className={clsx("margin-bottom--md", styles.showcaseFavoriteHeader)}>
<SearchBar setShowUserPrompts={setShowUserPrompts} setShowUserFavs={setShowUserFavs} />
</div>
<UserPrompts />
</>
)}
{showUserFavs && (
<>
<div className={clsx("margin-bottom--md", styles.showcaseFavoriteHeader)}>
<SearchBar setShowUserPrompts={setShowUserPrompts} setShowUserFavs={setShowUserFavs} />
</div>
<UserFavorite />
</>
)}
</section>
);
}

function SearchBar() {
function SearchBar({ setShowUserPrompts = (value) => {}, setShowUserFavs = (value) => {} }) {
const history = useHistory();
const location = useLocation();
const searchRef = useRef(null);
Expand All @@ -323,6 +337,8 @@ function SearchBar() {
search: newSearch.toString(),
state: prepareUserState(),
});
setShowUserPrompts(false);
setShowUserFavs(false);
}, [value, location, history]);

useEffect(() => {
Expand Down
26 changes: 21 additions & 5 deletions i18n/fr/docusaurus-plugin-content-pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function ShowcaseFilters({ onToggleDescription, showUserFavs, setShowUserFavs })
<ul className={clsx("clean-list", styles.checkboxList)}>
{userAuth && (
<>
<li className={styles.checkboxListItem} onClick={handleUserPrompts}>
<li className={`${styles.checkboxListItem} ${showUserPrompts ? styles.activeItem : ""}`} onClick={handleUserPrompts}>
<ShowcaseTooltip
text={translate({
id: "myprompt.tooltip",
Expand All @@ -206,7 +206,7 @@ function ShowcaseFilters({ onToggleDescription, showUserFavs, setShowUserFavs })
/>
</ShowcaseTooltip>
</li>
<li className={styles.checkboxListItem} onClick={handleUserFavs}>
<li className={`${styles.checkboxListItem} ${showUserFavs ? styles.activeItem : ""}`} onClick={handleUserFavs}>
<ShowcaseTooltip
text={translate({
id: "myfavorite.tooltip",
Expand Down Expand Up @@ -296,13 +296,27 @@ function ShowcaseFilters({ onToggleDescription, showUserFavs, setShowUserFavs })
</ShowcaseTooltip>
</li>
</ul>
{showUserPrompts && <UserPrompts />}
{showUserFavs && <UserFavorite />}
{showUserPrompts && (
<>
<div className={clsx("margin-bottom--md", styles.showcaseFavoriteHeader)}>
<SearchBar setShowUserPrompts={setShowUserPrompts} setShowUserFavs={setShowUserFavs} />
</div>
<UserPrompts />
</>
)}
{showUserFavs && (
<>
<div className={clsx("margin-bottom--md", styles.showcaseFavoriteHeader)}>
<SearchBar setShowUserPrompts={setShowUserPrompts} setShowUserFavs={setShowUserFavs} />
</div>
<UserFavorite />
</>
)}
</section>
);
}

function SearchBar() {
function SearchBar({ setShowUserPrompts = (value) => {}, setShowUserFavs = (value) => {} }) {
const history = useHistory();
const location = useLocation();
const searchRef = useRef(null);
Expand All @@ -323,6 +337,8 @@ function SearchBar() {
search: newSearch.toString(),
state: prepareUserState(),
});
setShowUserPrompts(false);
setShowUserFavs(false);
}, [value, location, history]);

useEffect(() => {
Expand Down
Loading

0 comments on commit 9ec6088

Please sign in to comment.