Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with react.dev @ fcd00068 #23

Closed
wants to merge 118 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
a30e1f9
update link to fault tolerance blog post (#6142)
aweary Jul 10, 2023
b9eea4d
Fix lint warnings (#6174)
rickhanlonii Jul 21, 2023
d86cfc4
Update useInsertionEffect docs (#6172)
rickhanlonii Jul 24, 2023
cf4ad19
Fix typo: "server-only" to "client-only" (#6164)
smikitky Jul 25, 2023
a132d8f
Remove junk lines in common.md (#6167)
smikitky Jul 25, 2023
6ebe2dd
Fix "onFocus" description (#6168)
smikitky Jul 25, 2023
39b9692
Update conferences timeline (#6159)
afonsojramos Jul 25, 2023
b452e7b
docs: separate dot from hyperlink (#6140)
jjm2317 Jul 25, 2023
505f651
Fix root-unmount returns (#6137)
solar3070 Jul 25, 2023
19c0fe2
fix `componentdidcatch` (#6107)
AhmedBaset Jul 25, 2023
a472775
docs: fix a broken link in react-labs-june-2022 (#6149)
MatanBobi Jul 25, 2023
cd13b52
Fix homepage title (#5838)
daochouwangu Aug 7, 2023
f82f392
Adds a TypeScript overview page (#6120)
orta Aug 9, 2023
c60bcac
Fix TerminalBlock overflow (#6208)
rickhanlonii Aug 10, 2023
03c2e96
Fix recipe titles (#6209)
rickhanlonii Aug 10, 2023
fcc639b
Fix IDs specified in the MDN page URLs (#6176)
natsuokawai Aug 10, 2023
ae06008
Add UI for canary releases (#6173)
rickhanlonii Aug 10, 2023
22d9878
Update correct link common.md (#6125)
NGHdeveloper Aug 10, 2023
02c0067
remove Bad grammar in react.dev tictactoe documentation (#6126)
DIWAKARKASHYAP Aug 11, 2023
a86663d
Fix IntersectionObserver examples (#6212)
rickhanlonii Aug 11, 2023
b1a5b7b
fix(docs): Component reference render parameters (#6098)
brunoeduardodev Aug 11, 2023
2bfa544
removing reference to create-react-app (#6012)
hannanel100 Aug 11, 2023
79560d6
fix: remove Hong Kong from choosing-the-state-structure (#5957)
umairraza96 Aug 11, 2023
819518c
RTL Languages Support (#6138)
AhmedBaset Aug 11, 2023
6b61cd4
Annex to #6138 (#6226)
AhmedBaset Aug 15, 2023
842c24c
Fix broken link for Typescript Discord invite (#6224)
ThomasCharuel Aug 17, 2023
f67811b
Clarify these features are not related to Next (#6229)
lunaleaps Aug 21, 2023
3189529
Add React Native EU 2023 to the conferences page (#6254)
elicwhite Aug 23, 2023
722b546
fix(docs): remove inactive indian meetup groups (#6267)
CarreraPHP Aug 30, 2023
9b4c56a
update conferences to move React Rally 23 to previous and add upcomin…
M0nica Sep 5, 2023
be6c39d
Update tutorial-tic-tac-toe.md (#6259)
0xSaksham Sep 5, 2023
05380da
Update conferences.md (#6256)
ThugDebugger Sep 5, 2023
cd09ffb
Update Twitter(X) icon for light and dark mode (#6235)
venom-10 Sep 5, 2023
230c39b
Fix link in new typescript docs (#6232)
maxjacobson Sep 5, 2023
14629a7
Fix incorrect link in select.md (#6227)
NGHdeveloper Sep 5, 2023
df9d907
Fix flushSync.md grammar (#6282)
minuminukim Sep 6, 2023
7141306
Add cache API docs (#6240)
lunaleaps Sep 6, 2023
9e144cd
Fix typo in preserving-and-resetting-state.md (#6194)
Aleksandar15 Sep 6, 2023
ee98f75
add rendercon kenya 2023 to conferences (#6133)
orama254 Sep 6, 2023
20ccdf9
Update lazy.md to mention default exports (#6285)
sophiebits Sep 7, 2023
46e7b2c
Fixes error in cloneElement code example (#6291)
drex04 Sep 8, 2023
742d2bf
Add use hook API reference page (#6177)
mattcarrollcode Sep 8, 2023
5219d73
Removed the multiple checks (#5759)
abhinav-m22 Sep 9, 2023
43ada1f
Sandpack 2.0: upgrade playgrounds (#5917)
danilowoz Sep 12, 2023
0d21915
Replace label with placeholder (#6295)
kahenya-anita Sep 13, 2023
bdc60c2
FIx typo: props => context (#6300)
smikitky Sep 14, 2023
cbeb0ba
Add French to fully-translated languages (#6305)
tdd Sep 19, 2023
dfd15e8
Remove "robot=noindex" meta tag (#6260)
smikitky Sep 20, 2023
5f3565f
Fix like button color
gaearon Sep 21, 2023
bad7e90
Update team page (#6310)
josephsavona Sep 22, 2023
2ab8334
Update common.md (#6290)
s0h311 Sep 23, 2023
828e30a
chore: log heading missing url error on dev only (#6280)
GSTJ Sep 23, 2023
a1fbcf8
Update useEffect.md - The explanation on the timing of useEffect() ca…
JSerZANP Sep 23, 2023
1758515
Fix text in docs (#6253)
smdmori Sep 23, 2023
2390627
fix links (#6286)
awxiaoxian2020 Sep 23, 2023
91e7f69
Update tutorial error message to use ConsoleBlock
AhmedBaset Sep 25, 2023
4df3e7c
Remove pitfall and update Next link (#6318)
lunaleaps Sep 26, 2023
62b9b45
Main (#5963)
JustLolo Sep 26, 2023
2dbd195
Fix an incorrect person's name (#6066)
jajimajp Sep 26, 2023
01c3163
fix: wrong parameter name defined in explanation (#6158)
MatanBobi Sep 26, 2023
8afb1ef
Add info about App.js 2024 conference (#6192)
piaskowyk Sep 26, 2023
850327d
Update "Start a new React project" for stable Next.js App Router (#6020)
leerob Sep 28, 2023
d4c214a
Update Page not found to React18 URL (#6320)
SouSingh Sep 28, 2023
1dfc88f
fix: typo in useMemo example (#6330)
alainkaiser Oct 1, 2023
68f417a
Explain how `null` ends up in `ref.current` for React-managed refs (#…
eps1lon Oct 1, 2023
c45fa10
Fix "primatives" typo in cache.md (#6335)
psikoi Oct 5, 2023
3cd1723
Mention `use` as a Suspense-enabled data source (#6340)
sophiebits Oct 6, 2023
9aa84b1
Add Experimental Taint API Docs (#6337)
sebmarkbage Oct 6, 2023
fdad54d
Explain limitations of useSyncExternalStore with concurrency (#6339)
sophiebits Oct 9, 2023
88af66d
Fix comma splice
sophiebits Oct 9, 2023
f2c45ea
Add labs icon to experimental APIs (#6346)
sophiebits Oct 9, 2023
43f4702
Fix typo in typescript.md (#6347)
mattcarrollcode Oct 11, 2023
900a669
Upgrade react-collapsed (#5893)
roginfarrer Oct 11, 2023
e85b71d
Add 'ja' to deployedTranslations (#6351)
smikitky Oct 13, 2023
31b7881
Add GA4 tag to react.dev (#6350)
kmiddleton14 Oct 16, 2023
d22efb3
Added new meetup in Saskatoon - SK (#6341)
galexandrade Oct 17, 2023
90ca701
Add `useFormStatus` Hook API reference documentation (#6314)
mattcarrollcode Oct 17, 2023
5750680
docs: Remove unnecessary `when` (#6344)
locol23 Oct 18, 2023
b68e15a
fix typo in react-dom/hooks (#6355)
dragonsuperf Oct 18, 2023
10574e5
fix: add a missing import statement in useFormStatus.md (#6356)
koba04 Oct 18, 2023
9af01e2
Describing Your UI > Your UI as a tree (#6334)
lunaleaps Oct 19, 2023
16f90a9
Minor fixes to Understand Your UI as a Tree learn doc (#6365)
mattcarrollcode Oct 20, 2023
a0cacd7
Fix onScroll → onWheel typo in common-props (#6364)
insanj Oct 22, 2023
717f9b5
Remove unsupported ga-lite and update existing calls to GA4 (#6366)
kmiddleton14 Oct 24, 2023
bbdbaca
Fixes related to "Your UI as a Tree" (#6374)
smikitky Oct 24, 2023
63f9470
Add Error Boundary to useTransition API docs (#6354)
kmiddleton14 Oct 24, 2023
2779615
Warn about low entropy in taintUniqueValue.md (#6379)
sophiebits Oct 24, 2023
5e40d13
Add useFormState reference (#6338)
davidmccabe Oct 25, 2023
6ef844b
useFormState reference fixes (#6383)
davidmccabe Oct 25, 2023
df3ec65
Fix typo in experimental_taintObjectReference (#6385)
elicwhite Oct 26, 2023
97e61d7
Fix broken links caused by #6164 (#6375)
smikitky Oct 26, 2023
a272f0c
chore: fix typos (#6387)
harish-sethuraman Oct 26, 2023
76c1bde
Using strict equality in the JS example for City Quiz (#6373)
jerrykodes Oct 26, 2023
6a94b72
docs: update link to React Query (#6369)
TkDodo Oct 26, 2023
f6b7f9e
Removed canary: true from useTransition.md (#6389)
kevinfarrugia Oct 26, 2023
4b333ca
Add <form> Component reference documentation (#6312)
mattcarrollcode Oct 26, 2023
5d2113b
typos (#6390)
harish-sethuraman Oct 27, 2023
46b45fb
Add `useOptimistic Hook` API reference documentation (#6377)
kmiddleton14 Oct 27, 2023
b8acf01
Remove meta description from most pages (#6392)
sophiebits Oct 27, 2023
4bdb87b
Try to fix Google titles for directive pages (#6393)
sophiebits Oct 28, 2023
81f1520
Adds Reference Overview Page (#6378)
brianjo Oct 30, 2023
49c2d78
'use server' fleshing out (#6384)
lunaleaps Oct 30, 2023
9c60167
'use client' - flesh out usages and reference (#6362)
lunaleaps Oct 30, 2023
f949428
Add closing </p> tag (#6394)
mixlaab Oct 31, 2023
40a88fa
Fix typoError Mentioned in issue (#6400)
DhanushShettyH Nov 3, 2023
a8790ca
Edits for new "use client" content (#6401)
sophiebits Nov 3, 2023
55b9e04
Remove "canary: true" from `useTransition` in Sidebar (#6411)
smikitky Nov 6, 2023
617065b
Fix style in React Reference Overview (#6410)
smikitky Nov 6, 2023
8727204
fix Illustration and IllustrationBlock alt color on dark mode (#5981)
oxcened Nov 6, 2023
42ca996
Captailize Server Action (#6417)
Huxpro Nov 7, 2023
292e55d
Capitalize Client/Server Component (#6418)
Huxpro Nov 7, 2023
c5a2e15
Capitalize Client in "client modules" (#6419)
Huxpro Nov 7, 2023
721479b
Check for value before passing to gtag (#6415)
kmiddleton14 Nov 7, 2023
eeb0979
Update event label and value name (#6421)
kmiddleton14 Nov 8, 2023
49ebed1
Fix useOptimistic demo bug (#6422)
kmiddleton14 Nov 8, 2023
44f442d
Add space for canary title (#6416)
lunaleaps Nov 8, 2023
fcd0006
Capitalize word "Hook" (#6424)
Huxpro Nov 10, 2023
1b59701
Merge branch 'main' of https://github.com/reactjs/react.dev into sync…
react-translations-bot Nov 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
SANDPACK_BARE_COMPONENTS=true
3 changes: 1 addition & 2 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
NEXT_PUBLIC_GA_TRACKING_ID = 'UA-41298772-4'
SANDPACK_BARE_COMPONENTS=true
NEXT_PUBLIC_GA_TRACKING_ID = 'G-B1E83PJ3RT'
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"plugins": ["@typescript-eslint"],
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "warn"
"@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "^_" }],
"react-hooks/exhaustive-deps": "error"
},
"env": {
"node": true,
Expand Down
8 changes: 1 addition & 7 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ const nextConfig = {
scrollRestoration: true,
legacyBrowsers: false,
},
env: {
SANDPACK_BARE_COMPONENTS: process.env.SANDPACK_BARE_COMPONENTS,
},
env: {},
webpack: (config, {dev, isServer, ...options}) => {
if (process.env.ANALYZE) {
const {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer');
Expand All @@ -35,10 +33,6 @@ const nextConfig = {

const {IgnorePlugin, NormalModuleReplacementPlugin} = require('webpack');
config.plugins.push(
new NormalModuleReplacementPlugin(
/^@stitches\/core$/,
require.resolve('./src/utils/emptyShim.js')
),
new NormalModuleReplacementPlugin(
/^raf$/,
require.resolve('./src/utils/rafShim.js')
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,20 @@
"check-all": "npm-run-all prettier lint:fix tsc"
},
"dependencies": {
"@codesandbox/sandpack-react": "1.15.5",
"@codesandbox/sandpack-react": "2.6.0",
"@docsearch/css": "3.0.0-alpha.41",
"@docsearch/react": "3.0.0-alpha.41",
"@headlessui/react": "^1.7.0",
"body-scroll-lock": "^3.1.3",
"classnames": "^2.2.6",
"date-fns": "^2.16.1",
"debounce": "^1.2.1",
"ga-lite": "^2.1.4",
"github-slugger": "^1.3.0",
"next": "^13.4.1",
"next-remote-watch": "^1.0.0",
"parse-numeric-range": "^1.2.0",
"react": "^0.0.0-experimental-16d053d59-20230506",
"react-collapsed": "npm:@gaearon/[email protected]",
"react-collapsed": "4.0.4",
"react-dom": "^0.0.0-experimental-16d053d59-20230506",
"remark-frontmatter": "^4.0.1",
"remark-gfm": "^3.0.1"
Expand Down Expand Up @@ -92,7 +91,7 @@
"retext": "^7.0.1",
"retext-smartypants": "^4.0.0",
"rss": "^1.2.2",
"tailwindcss": "^3.0.22",
"tailwindcss": "^3.3.2",
"typescript": "^4.0.2",
"unist-util-visit": "^2.0.3",
"webpack-bundle-analyzer": "^4.5.0"
Expand Down
30 changes: 0 additions & 30 deletions patches/@codemirror+lang-javascript+0.19.6.patch

This file was deleted.

62 changes: 0 additions & 62 deletions patches/@codesandbox+sandpack-react+1.15.5.patch

This file was deleted.

345 changes: 0 additions & 345 deletions patches/@lezer+javascript+0.15.2.patch

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/docs/diagrams/render_tree.dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/docs/diagrams/render_tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/images/team/dave-mccabe.jpg
Binary file not shown.
Binary file removed public/images/team/lunaruan.jpg
Binary file not shown.
Binary file removed public/images/team/mengdi-chen.jpg
Binary file not shown.
Binary file removed public/images/team/sean-keegan.jpg
Binary file not shown.
4 changes: 2 additions & 2 deletions src/components/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ function Breadcrumbs({breadcrumbs}: {breadcrumbs: RouteItem[]}) {
<Fragment key={crumb.path}>
<Link
href={crumb.path}
className="text-link dark:text-link-dark text-sm tracking-wide font-bold uppercase mr-1 hover:underline">
className="text-link dark:text-link-dark text-sm tracking-wide font-bold uppercase me-1 hover:underline">
{crumb.title}
</Link>
<span className="inline-block mr-1 text-link dark:text-link-dark text-lg">
<span className="inline-block me-1 text-link dark:text-link-dark text-lg rtl:rotate-180">
<svg
width="20"
height="20"
Expand Down
4 changes: 2 additions & 2 deletions src/components/DocsFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ function FooterLink({
className={cn(
'flex gap-x-4 md:gap-x-6 items-center w-full md:w-80 px-4 md:px-5 py-6 border-2 border-transparent text-base leading-base text-link dark:text-link-dark rounded-lg group focus:text-link dark:focus:text-link-dark focus:bg-highlight focus:border-link dark:focus:bg-highlight-dark dark:focus:border-link-dark focus:border-opacity-100 focus:border-2 focus:ring-1 focus:ring-offset-4 focus:ring-blue-40 active:ring-0 active:ring-offset-0 hover:bg-gray-5 dark:hover:bg-gray-80',
{
'flex-row-reverse justify-self-end text-right': type === 'Next',
'flex-row-reverse justify-self-end text-end': type === 'Next',
}
)}>
<IconNavArrow
className="text-tertiary dark:text-tertiary-dark inline group-focus:text-link dark:group-focus:text-link-dark"
displayDirection={type === 'Previous' ? 'left' : 'right'}
displayDirection={type === 'Previous' ? 'start' : 'end'}
/>
<span>
<span className="block no-underline text-sm tracking-wide text-secondary dark:text-secondary-dark uppercase font-bold group-focus:text-link dark:group-focus:text-link-dark group-focus:text-opacity-100">
Expand Down
8 changes: 7 additions & 1 deletion src/components/Icon/IconArrow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import cn from 'classnames';

export const IconArrow = memo<
JSX.IntrinsicElements['svg'] & {
displayDirection: 'left' | 'right' | 'up' | 'down';
/**
* The direction the arrow should point.
* `start` and `end` are relative to the current locale.
* for example, in LTR, `start` is left and `end` is right.
*/
displayDirection: 'start' | 'end' | 'right' | 'left' | 'up' | 'down';
}
>(function IconArrow({displayDirection, className, ...rest}) {
return (
Expand All @@ -20,6 +25,7 @@ export const IconArrow = memo<
{...rest}
className={cn(className, {
'rotate-180': displayDirection === 'right',
'rotate-180 rtl:rotate-0': displayDirection === 'end',
})}>
<path fill="none" d="M0 0h24v24H0z" />
<path d="M7.828 11H20v2H7.828l5.364 5.364-1.414 1.414L4 12l7.778-7.778 1.414 1.414z" />
Expand Down
8 changes: 7 additions & 1 deletion src/components/Icon/IconArrowSmall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ import cn from 'classnames';

export const IconArrowSmall = memo<
JSX.IntrinsicElements['svg'] & {
displayDirection: 'left' | 'right' | 'up' | 'down';
/**
* The direction the arrow should point.
* `start` and `end` are relative to the current locale.
* for example, in LTR, `start` is left and `end` is right.
*/
displayDirection: 'start' | 'end' | 'right' | 'left' | 'up' | 'down';
}
>(function IconArrowSmall({displayDirection, className, ...rest}) {
const classes = cn(className, {
'rotate-180': displayDirection === 'left',
'rotate-180 rtl:rotate-0': displayDirection === 'start',
'rotate-90': displayDirection === 'down',
});
return (
Expand Down
32 changes: 32 additions & 0 deletions src/components/Icon/IconCanary.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/

import {memo} from 'react';

export const IconCanary = memo<JSX.IntrinsicElements['svg'] & {title?: string}>(
function IconCanary({className, title}) {
return (
<svg
className={className}
width="20px"
height="20px"
viewBox="0 0 20 20"
version="1.1"
xmlns="http://www.w3.org/2000/svg">
{title && <title>{title}</title>}
<g stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
<g
id="noun-labs-1201738-(2)"
transform="translate(2, 0)"
fill="currentColor"
fillRule="nonzero">
<path
d="M10.2865804,5.55665262 L10.2865804,2.22331605 L10.8591544,2.22331605 C11.0103911,2.22244799 11.1551447,2.16342155 11.2617505,2.05914367 C11.3684534,1.95486857 11.4282767,1.81370176 11.4282767,1.66667106 L11.4282767,0.556642208 C11.4282767,0.40907262 11.3678934,0.26747526 11.2605218,0.16308627 C11.1531503,0.0587028348 11.0074938,0 10.8556998,0 L5.14338868,0 C4.9915947,0 4.84594391,0.0587028348 4.73856664,0.16308627 C4.63119507,0.267469704 4.57081178,0.40907262 4.57081178,0.556642208 L4.57081178,1.66667106 C4.57081178,1.81434899 4.63119507,1.95594912 4.73856664,2.06033811 C4.8459382,2.16472155 4.9915947,2.22331605 5.14338868,2.22331605 L5.71596273,2.22331605 L5.71596273,5.55665262 C5.71596273,8.38665538 2.97295619,9.88999017 0.651686904,15.5566623 C-0.0957823782,17.360053 -2.00560068,20 7.99951567,20 C18.004632,20 16.0948137,17.3600252 15.3507732,15.5566623 C13.0124432,9.88999017 10.2865804,8.38665538 10.2865804,5.55665262 Z M9.89570197,10.709991 C10.0921412,10.709991 10.2805515,10.7858383 10.4193876,10.9209301 C10.5583466,11.0559135 10.6363652,11.2390693 10.6363652,11.4300417 C10.6363652,11.6210141 10.5583466,11.8040698 10.4193876,11.9391533 C10.2805401,12.0741367 10.0921412,12.1499813 9.89570197,12.1499813 C9.6992627,12.1499813 9.51096673,12.074134 9.37201631,11.9391533 C9.23316875,11.8040615 9.15515307,11.6210141 9.15515307,11.4300417 C9.15515307,11.2390693 9.2331716,11.0559024 9.37201631,10.9209301 C9.57264221,10.7258996 9.61239426,10.709991 9.89570197,10.709991 Z M8.98919546,9.04212824 C9.09790709,9.14792278 9.15884755,9.29158681 9.1585213,9.44110085 C9.15829001,9.59073155 9.09678989,9.73407335 8.98763252,9.83954568 C8.87847514,9.945018 8.73069852,10.0039347 8.57678157,10.0033977 C8.42286747,10.0027392 8.27565088,9.94273467 8.16727355,9.83639845 C8.05900765,9.73006224 7.99873866,9.58628988 7.99963013,9.43664806 C8.00052304,9.28788403 8.0620221,9.14542556 8.17051087,9.04048101 C8.27911107,8.93555591 8.42599335,8.87663641 8.57913312,8.87663641 C8.73291864,8.87665585 8.88047525,8.93622535 8.98919546,9.04212824 Z M7.99965585,17.9999981 C4.91377349,17.9999981 3.29882839,17.7332867 2.51364277,17.4999976 C2.37780966,17.4476975 2.26954376,17.3439641 2.21396931,17.2125528 C2.15838628,17.0811499 2.16006066,16.9334692 2.21876871,16.8033858 C2.6144474,15.5921346 3.14916224,14.4280501 3.81316983,13.3333824 C5.980145,9.82337899 8.22941036,13.8867718 10.0980836,13.8867718 C11.9666996,13.8867718 11.4695868,12.1534924 12.1827971,13.3333824 C12.8511505,14.4269112 13.3916656,15.5896902 13.794259,16.8000524 C13.8533022,16.9322137 13.8537479,17.0822749 13.7952635,17.2147751 C13.7368889,17.3472613 13.6248314,17.4504531 13.4856467,17.5000531 C12.6833967,17.7332867 11.0855382,17.9999981 7.99965585,17.9999981 Z"
id="Shape"></path>
</g>
</g>
</svg>
);
}
);
9 changes: 8 additions & 1 deletion src/components/Icon/IconChevron.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import cn from 'classnames';

export const IconChevron = memo<
JSX.IntrinsicElements['svg'] & {
displayDirection: 'up' | 'down' | 'left' | 'right';
/**
* The direction the arrow should point.
* `start` and `end` are relative to the current locale.
* for example, in LTR, `start` is left and `end` is right.
*/
displayDirection: 'start' | 'end' | 'right' | 'left' | 'up' | 'down';
}
>(function IconChevron({className, displayDirection}) {
const classes = cn(
Expand All @@ -16,6 +21,8 @@ export const IconChevron = memo<
'rotate-90': displayDirection === 'left',
'rotate-180': displayDirection === 'up',
'-rotate-90': displayDirection === 'right',
'rotate-90 rtl:-rotate-90': displayDirection === 'start',
'-rotate-90 rtl:rotate-90': displayDirection === 'end',
},
className
);
Expand Down
13 changes: 10 additions & 3 deletions src/components/Icon/IconNavArrow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,22 @@ import cn from 'classnames';

export const IconNavArrow = memo<
JSX.IntrinsicElements['svg'] & {
displayDirection: 'right' | 'down' | 'left';
/**
* The direction the arrow should point.
* `start` and `end` are relative to the current locale.
* for example, in LTR, `start` is left and `end` is right.
*/
displayDirection: 'start' | 'end' | 'right' | 'left' | 'down';
}
>(function IconNavArrow({displayDirection = 'right', className}) {
>(function IconNavArrow({displayDirection = 'start', className}) {
const classes = cn(
'duration-100 ease-in transition',
{
'rotate-0': displayDirection === 'down',
'-rotate-90': displayDirection === 'right',
'rotate-90': displayDirection === 'left',
'-rotate-90': displayDirection === 'right',
'rotate-90 rtl:-rotate-90': displayDirection === 'start',
'-rotate-90 rtl:rotate-90': displayDirection === 'end',
},
className
);
Expand Down
8 changes: 4 additions & 4 deletions src/components/Icon/IconTwitter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ export const IconTwitter = memo<JSX.IntrinsicElements['svg']>(
return (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="1.33em"
height="1.33em"
viewBox="0 0 512 512"
height="1.30em"
width="1.30em"
fill="currentColor"
{...props}>
<path fill="none" d="M0 0h24v24H0z" />
<path d="M22.162 5.656a8.384 8.384 0 0 1-2.402.658A4.196 4.196 0 0 0 21.6 4c-.82.488-1.719.83-2.656 1.015a4.182 4.182 0 0 0-7.126 3.814 11.874 11.874 0 0 1-8.62-4.37 4.168 4.168 0 0 0-.566 2.103c0 1.45.738 2.731 1.86 3.481a4.168 4.168 0 0 1-1.894-.523v.052a4.185 4.185 0 0 0 3.355 4.101 4.21 4.21 0 0 1-1.89.072A4.185 4.185 0 0 0 7.97 16.65a8.394 8.394 0 0 1-6.191 1.732 11.83 11.83 0 0 0 6.41 1.88c7.693 0 11.9-6.373 11.9-11.9 0-.18-.005-.362-.013-.54a8.496 8.496 0 0 0 2.087-2.165z" />
<path d="M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z" />
</svg>
);
}
Expand Down
21 changes: 10 additions & 11 deletions src/components/Layout/Feedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import {useState} from 'react';
import {useRouter} from 'next/router';
import {ga} from '../../utils/analytics';

export function Feedback({onSubmit = () => {}}: {onSubmit?: () => void}) {
const {asPath} = useRouter();
Expand Down Expand Up @@ -46,29 +45,29 @@ const thumbsDownIcon = (
);

function sendGAEvent(isPositive: boolean) {
const category = isPositive ? 'like_button' : 'dislike_button';
const value = isPositive ? 1 : 0;
// Fragile. Don't change unless you've tested the network payload
// and verified that the right events actually show up in GA.
ga(
'send',
'event',
'button',
'feedback',
window.location.pathname,
isPositive ? '1' : '0'
);
// @ts-ignore
gtag('event', 'feedback', {
event_category: category,
event_label: window.location.pathname,
event_value: value,
});
}

function SendFeedback({onSubmit}: {onSubmit: () => void}) {
const [isSubmitted, setIsSubmitted] = useState(false);
return (
<div className="max-w-xs w-80 lg:w-auto py-3 shadow-lg rounded-lg m-4 bg-wash dark:bg-gray-95 px-4 flex">
<p className="w-full font-bold text-primary dark:text-primary-dark text-lg mr-4">
<p className="w-full font-bold text-primary dark:text-primary-dark text-lg me-4">
{isSubmitted ? 'Thank you for your feedback!' : 'Is this page useful?'}
</p>
{!isSubmitted && (
<button
aria-label="Yes"
className="bg-secondary-button dark:bg-secondary-button-dark rounded-lg text-primary dark:text-primary-dark px-3 mr-2"
className="bg-secondary-button dark:bg-secondary-button-dark rounded-lg text-primary dark:text-primary-dark px-3 me-2"
onClick={() => {
setIsSubmitted(true);
onSubmit();
Expand Down
6 changes: 4 additions & 2 deletions src/components/Layout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function Footer() {
return (
<footer className={cn('text-secondary dark:text-secondary-dark')}>
<div className="grid grid-cols-2 md:grid-cols-3 xl:grid-cols-5 gap-x-12 gap-y-8 max-w-7xl mx-auto">
<div className="col-span-2 md:col-span-1 justify-items-start mt-3.5 text-left">
<div className="col-span-2 md:col-span-1 justify-items-start mt-3.5">
<ExternalLink
href="https://opensource.fb.com/"
aria-label="Meta Open Source">
Expand Down Expand Up @@ -280,7 +280,9 @@ export function Footer() {
</div>
</ExternalLink>

<div className="text-xs text-left mt-2 pr-0.5">
<div
className="text-xs text-left rtl:text-right mt-2 pe-0.5"
dir="ltr">
&copy;{new Date().getFullYear()}
</div>
</div>
Expand Down
Loading
Loading