-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(website): refactor showcase components (#10023)
- Loading branch information
Showing
28 changed files
with
723 additions
and
822 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -301,7 +301,6 @@ rtcts | |
rtlcss | ||
saurus | ||
Scaleway | ||
searchbar | ||
Sebastien | ||
sebastien | ||
sebastienlorber | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
website/src/pages/showcase/_components/ClearAllButton/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React, {type ReactNode} from 'react'; | ||
import {useClearQueryString} from '@docusaurus/theme-common'; | ||
|
||
export default function ClearAllButton(): ReactNode { | ||
const clearQueryString = useClearQueryString(); | ||
// TODO translate | ||
return ( | ||
<button | ||
className="button button--outline button--primary" | ||
type="button" | ||
onClick={() => clearQueryString()}> | ||
Clear All | ||
</button> | ||
); | ||
} |
32 changes: 32 additions & 0 deletions
32
website/src/pages/showcase/_components/FavoriteIcon/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React, {type ComponentProps} from 'react'; | ||
import clsx from 'clsx'; | ||
|
||
import styles from './styles.module.css'; | ||
|
||
interface Props { | ||
className?: string; | ||
style?: ComponentProps<'svg'>['style']; | ||
size: 'small' | 'medium' | 'large'; | ||
} | ||
|
||
export default function FavoriteIcon({ | ||
size, | ||
className, | ||
style, | ||
}: Props): React.ReactNode { | ||
return ( | ||
<svg | ||
viewBox="0 0 24 24" | ||
className={clsx(styles.svg, styles[size], className)} | ||
style={style}> | ||
<path d="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z" /> | ||
</svg> | ||
); | ||
} |
27 changes: 27 additions & 0 deletions
27
website/src/pages/showcase/_components/FavoriteIcon/styles.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
.svg { | ||
user-select: none; | ||
color: #e9669e; | ||
width: 1em; | ||
height: 1em; | ||
display: inline-block; | ||
fill: currentColor; | ||
} | ||
|
||
.small { | ||
font-size: 1rem; | ||
} | ||
|
||
.medium { | ||
font-size: 1.25rem; | ||
} | ||
|
||
.large { | ||
font-size: 1.8rem; | ||
} |
41 changes: 41 additions & 0 deletions
41
website/src/pages/showcase/_components/OperatorButton/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React, {useId} from 'react'; | ||
import clsx from 'clsx'; | ||
import {useOperator} from '../../_utils'; | ||
|
||
import styles from './styles.module.css'; | ||
|
||
export default function OperatorButton() { | ||
const id = useId(); | ||
const [operator, toggleOperator] = useOperator(); | ||
// TODO add translations | ||
return ( | ||
<> | ||
<input | ||
id={id} | ||
type="checkbox" | ||
className="screen-reader-only" | ||
aria-label="Toggle between or and and for the tags you selected" | ||
checked={operator === 'AND'} | ||
onChange={toggleOperator} | ||
onKeyDown={(e) => { | ||
if (e.key === 'Enter') { | ||
toggleOperator(); | ||
} | ||
}} | ||
/> | ||
<label htmlFor={id} className={clsx(styles.checkboxLabel, 'shadow--md')}> | ||
{/* eslint-disable @docusaurus/no-untranslated-text */} | ||
<span className={styles.checkboxLabelOr}>OR</span> | ||
<span className={styles.checkboxLabelAnd}>AND</span> | ||
{/* eslint-enable @docusaurus/no-untranslated-text */} | ||
</label> | ||
</> | ||
); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.