Skip to content

Commit

Permalink
docs(en): merging all conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
docschina-bot committed Dec 1, 2021
2 parents 540c99d + f625b86 commit caea620
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 56 deletions.
6 changes: 3 additions & 3 deletions beta/.husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
. "$(dirname "$0")/_/husky.sh"

cd beta
yarn generate-ids
git add -u src/pages/**/*.md
# yarn generate-ids
# git add -u src/pages/**/*.md
yarn prettier
yarn lint:fix
yarn lint:fix
4 changes: 1 addition & 3 deletions beta/src/components/Layout/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ export function Page({routeTree, children}: PageProps) {

<div className="flex flex-1 w-full h-full self-stretch">
<div className="w-full min-w-0">
<main
className="flex flex-1 self-stretch flex-col items-end"
style={{justifyContent: 'space-around'}}>
<main className="flex flex-1 self-stretch flex-col items-end justify-around">
{children}
<Footer />
</main>
Expand Down
10 changes: 3 additions & 7 deletions beta/src/components/Layout/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function Sidebar({isMobileOnly}: {isMobileOnly?: boolean}) {
const {menuRef, isOpen} = React.useContext(MenuContext);
const isMobileSidebar = useMediaQuery(SIDEBAR_BREAKPOINT);
let routeTree = React.useContext(SidebarContext);
const isHidden = isMobileOnly && !isMobileSidebar;
const isHidden = isMobileSidebar ? !isOpen : false;

// HACK. Fix up the data structures instead.
if ((routeTree as any).routes.length === 1) {
Expand Down Expand Up @@ -62,14 +62,10 @@ export function Sidebar({isMobileOnly}: {isMobileOnly?: boolean}) {
return (
<aside
className={cn(
`lg:flex-grow lg:flex flex-col w-full pt-4 pb-8 lg:pb-0 lg:max-w-xs fixed lg:sticky bg-wash dark:bg-wash-dark z-10`,
`lg:flex-grow lg:flex flex-col w-full pt-4 pb-8 lg:pb-0 lg:max-w-xs fixed lg:sticky bg-wash dark:bg-wash-dark z-10 top-0`,
isOpen ? 'block z-40' : 'hidden lg:block'
)}
aria-hidden={isHidden ? 'true' : 'false'}
style={{
top: 0,
visibility: isHidden ? 'hidden' : undefined,
}}>
aria-hidden={isHidden}>
<div className="px-5">
<Search />
</div>
Expand Down
3 changes: 2 additions & 1 deletion beta/src/components/Layout/Sidebar/SidebarRouteTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/

import * as React from 'react';
import cn from 'classnames';
import {RouteItem} from 'components/Layout/useRouteMeta';
import {useRouter} from 'next/router';
import {removeFromLast} from 'utils/removeFromLast';
Expand Down Expand Up @@ -59,8 +60,8 @@ function CollapseWrapper({
return (
<div
ref={ref}
className={cn(isExpanded ? 'opacity-100' : 'opacity-50')}
style={{
opacity: isExpanded ? 1 : 0.5,
transition: `opacity ${duration}ms ease-in-out`,
animation: `nav-fadein ${duration}ms ease-in-out`,
}}>
Expand Down
3 changes: 0 additions & 3 deletions beta/src/components/MDX/APIAnatomy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ export function AnatomyStep({
const color = colors[stepNumber - 1];
return (
<div
style={{
borderLeftColor: color.hex,
}}
className={cn(
'border-l-4 rounded-lg px-5 pt-8 pb-2 bg-opacity-5 shadow-inner',
color.border,
Expand Down
10 changes: 5 additions & 5 deletions beta/src/components/MDX/Heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ const Heading = forwardRefWithAs<HeadingProps, 'div'>(function Heading(
{isPageAnchor && (
<a
href={`#${id}`}
className={anchorClassName}
aria-hidden={true}
style={{
display: Comp === 'h1' ? 'none' : 'inline-block',
}}>
className={cn(
anchorClassName,
Comp === 'h1' ? 'hidden' : 'inline-block'
)}
aria-hidden="true">
<svg
width="1em"
height="1em"
Expand Down
46 changes: 21 additions & 25 deletions beta/src/components/MDX/Sandpack/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,6 @@ export function Preview({
: null;
const hideContent = !isReady || error;

// Allow content to be scrolled if it's too high to fit.
// Note we don't want this in the expanded state
// because it breaks position: sticky (and isn't needed anyway).
// We also don't want this for errors because they expand
// parent and making them scrollable is confusing.
let overflow;
if (!isExpanded && !error && isReady) {
overflow = 'auto';
}

// WARNING:
// The layout and styling here is convoluted and really easy to break.
// If you make changes to it, you need to test different cases:
Expand All @@ -136,9 +126,14 @@ export function Preview({
}}>
<div
className={cn(
'p-0 sm:p-2 md:p-4 lg:p-8 bg-card dark:bg-wash-dark h-full relative rounded-b-lg lg:rounded-b-none'
)}
style={{overflow}}>
'p-0 sm:p-2 md:p-4 lg:p-8 bg-card dark:bg-wash-dark h-full relative rounded-b-lg lg:rounded-b-none',
// Allow content to be scrolled if it's too high to fit.
// Note we don't want this in the expanded state
// because it breaks position: sticky (and isn't needed anyway).
// We also don't want this for errors because they expand
// parent and making them scrollable is confusing.
!isExpanded && !error && isReady ? 'overflow-auto' : null
)}>
<div
style={{
padding: 'initial',
Expand All @@ -151,31 +146,32 @@ export function Preview({
}}>
<iframe
ref={iframeRef}
className="rounded-t-none bg-white shadow-md sm:rounded-lg w-full max-w-full"
title="Sandbox Preview"
style={{
height: iframeComputedHeight || '100%',
position: hideContent ? 'absolute' : undefined,
className={cn(
'rounded-t-none bg-white shadow-md sm:rounded-lg w-full max-w-full',
// We can't *actually* hide content because that would
// break calculating the computed height in the iframe
// (which we're using for autosizing). This is noticeable
// if you make a compiler error and then fix it with code
// that expands the content. You want to measure that.
opacity: hideContent ? 0 : 1,
pointerEvents: hideContent ? 'none' : undefined,
hideContent
? 'absolute opacity-0 pointer-events-none'
: 'opacity-100'
)}
title="Sandbox Preview"
style={{
height: iframeComputedHeight || '100%',
zIndex: isExpanded ? 'initial' : -1,
}}
/>
</div>
{error && (
<div
className="p-2"
style={{
className={cn(
'p-2',
// This isn't absolutely positioned so that
// the errors can also expand the parent height.
position: isExpanded ? 'sticky' : undefined,
top: isExpanded ? '2rem' : '',
}}>
isExpanded ? 'sticky top-8' : null
)}>
<Error error={error} />
</div>
)}
Expand Down
3 changes: 1 addition & 2 deletions beta/src/components/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ function Hit({hit, children}: any) {
function Kbd(props: {children?: React.ReactNode}) {
return (
<kbd
className="border border-transparent mr-1 bg-wash dark:bg-wash-dark text-gray-30 align-middle p-0 inline-flex justify-center items-center text-xs text-center rounded"
style={{width: '2.25em', height: '2.25em'}}
className="h-6 w-6 border border-transparent mr-1 bg-wash dark:bg-wash-dark text-gray-30 align-middle p-0 inline-flex justify-center items-center text-xs text-center rounded"
{...props}
/>
);
Expand Down
6 changes: 5 additions & 1 deletion beta/src/pages/community/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ Stack Overflow 是非常受欢迎的论坛,在论坛中,你可以提出代

<!--
TODO: decide on the criteria for inclusion before uncommenting.
TODO: decide on the criteria for inclusion before uncommenting. (Change Popular Discussion Forums into heading while un-commenting)
<<<<<<< HEAD
## 热门讨论区 {/*popular-discussion-forums*/}
=======
Popular Discussion Forums
>>>>>>> f625b86a48309a430b90d92d233d93c010de62da
许多论坛是讨论最佳实践、应用架构以及 React 新特性的好地方。但如果你想讨论的是代码级问题,通常 Stack Overflow 会更合适。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ The next time you see `{{` and `}}` in JSX, know that it's nothing more than an
<Gotcha>
Inline `style` properties are written in camelCase. For example, HTML `<ul style="background-color: black"`> would be written as `<ul style={{ backgroundColor: 'black' }}>` in your component.
Inline `style` properties are written in camelCase. For example, HTML `<ul style="background-color: black">` would be written as `<ul style={{ backgroundColor: 'black' }}>` in your component.
</Gotcha>
Expand Down
10 changes: 5 additions & 5 deletions content/community/conferences.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ redirect_from:

## 即将举行的会议 {#upcoming-conferences}

### React India 2021 {#react-india-2021}
November 12-13, 2021 - remote event

[Website](https://www.reactindia.io) - [Twitter](https://twitter.com/react_india) - [Facebook](https://www.facebook.com/ReactJSIndia/) - [LinkedIn](https://www.linkedin.com/showcase/14545585) - [YouTube](https://www.youtube.com/channel/UCaFbHCBkPvVv1bWs_jwYt3w/videos)

### React Conf 2021 {#react-conf-2021}
December 8, 2021 - remote event (replay event on December 9)

Expand Down Expand Up @@ -49,6 +44,11 @@ June 17 & 21, 2022. In-person in Amsterdam, Netherlands + remote first interacti

## 往届会议 {#past-conferences}

### React India 2021 {#react-india-2021}
November 12-13, 2021 - remote event

[Website](https://www.reactindia.io) - [Twitter](https://twitter.com/react_india) - [Facebook](https://www.facebook.com/ReactJSIndia/) - [LinkedIn](https://www.linkedin.com/showcase/14545585) - [YouTube](https://www.youtube.com/channel/UCaFbHCBkPvVv1bWs_jwYt3w/videos)

### < React Global > by Geekle {#react-global-2021}
November 3-4, 2021 - remote event

Expand Down

0 comments on commit caea620

Please sign in to comment.