-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2028 from thematters/stage
Release: v3.23.1
- Loading branch information
Showing
22 changed files
with
490 additions
and
462 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "matters-web", | ||
"version": "3.23.0", | ||
"version": "3.23.1", | ||
"description": "codebase of Matters' website", | ||
"sideEffects": false, | ||
"author": "Matters <[email protected]>", | ||
|
@@ -45,9 +45,9 @@ | |
"@reach/alert": "^0.15.0", | ||
"@reach/dialog": "^0.15.0", | ||
"@reach/visually-hidden": "^0.15.0", | ||
"@sentry/browser": "^6.2.5", | ||
"@sentry/browser": "^6.3.3", | ||
"@stripe/react-stripe-js": "^1.4.0", | ||
"@stripe/stripe-js": "^1.13.2", | ||
"@stripe/stripe-js": "^1.14.0", | ||
"@tippyjs/react": "^4.2.5", | ||
"apollo-cache-inmemory": "^1.6.6", | ||
"apollo-cache-persist": "^0.1.1", | ||
|
@@ -61,7 +61,7 @@ | |
"autosize": "^4.0.2", | ||
"classnames": "^2.3.1", | ||
"date-fns": "^2.21.1", | ||
"embla-carousel": "^4.4.0", | ||
"embla-carousel": "^4.5.0", | ||
"express": "^4.17.1", | ||
"fastest-levenshtein": "^1.0.12", | ||
"fingerprintjs2": "^2.1.4", | ||
|
@@ -72,7 +72,7 @@ | |
"isomorphic-unfetch": "^3.1.0", | ||
"jump.js": "^1.0.2", | ||
"lodash": "^4.17.21", | ||
"next": "^10.1.3", | ||
"next": "^10.2.0", | ||
"next-with-apollo": "^5.1.1", | ||
"nprogress": "^0.2.0", | ||
"number-precision": "^1.5.0", | ||
|
@@ -85,13 +85,13 @@ | |
"react-dom": "^17.0.2", | ||
"react-focus-lock": "^2.5.0", | ||
"react-remove-scroll": "^2.4.1", | ||
"react-spring": "^9.1.1", | ||
"react-spring": "^9.1.2", | ||
"react-use-gesture": "^9.1.3", | ||
"react-virtualized": "^9.22.3", | ||
"react-waypoint": "^9.0.3", | ||
"subscriptions-transport-ws": "^0.9.18", | ||
"use-debounce": "^6.0.1", | ||
"validator": "^13.5.2" | ||
"validator": "^13.6.0" | ||
}, | ||
"devDependencies": { | ||
"@apollo/react-testing": "^3.1.3", | ||
|
@@ -104,7 +104,7 @@ | |
"@svgr/webpack": "^5.5.0", | ||
"@testing-library/react": "^11.2.6", | ||
"@types/autosize": "^3.0.7", | ||
"@types/classnames": "^2.2.11", | ||
"@types/classnames": "^2.3.1", | ||
"@types/express": "^4.17.9", | ||
"@types/fingerprintjs2": "^2.0.0", | ||
"@types/grecaptcha": "^3.0.1", | ||
|
@@ -113,7 +113,7 @@ | |
"@types/lodash": "^4.14.168", | ||
"@types/nprogress": "0.2.0", | ||
"@types/pulltorefreshjs": "^0.1.4", | ||
"@types/react": "^17.0.3", | ||
"@types/react": "^17.0.4", | ||
"@types/react-beautiful-dnd": "^13.0.0", | ||
"@types/react-copy-to-clipboard": "^5.0.0", | ||
"@types/react-dom": "^17.0.3", | ||
|
@@ -129,7 +129,7 @@ | |
"babel-plugin-dynamic-import-node": "^2.3.3", | ||
"babel-polyfill": "^6.26.0", | ||
"chromedriver": "^90.0.0", | ||
"core-js": "^3.10.1", | ||
"core-js": "^3.11.1", | ||
"cucumber": "^6.0.5", | ||
"cucumber-pretty": "^6.0.0", | ||
"cz-conventional-changelog": "^3.3.0", | ||
|
@@ -153,10 +153,10 @@ | |
"prettier": "^2.2.1", | ||
"react-is": "^17.0.2", | ||
"styled-jsx-plugin-postcss": "^3.0.2", | ||
"stylelint": "^13.12.0", | ||
"stylelint": "^13.13.0", | ||
"stylelint-config-prettier": "^8.0.2", | ||
"stylelint-config-recess-order": "^2.3.0", | ||
"stylelint-config-standard": "^21.0.0", | ||
"stylelint-config-recess-order": "^2.4.0", | ||
"stylelint-config-standard": "^22.0.0", | ||
"stylelint-prettier": "^1.2.0", | ||
"ts-jest": "^26.5.5", | ||
"ts-node": "^9.1.1", | ||
|
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
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
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
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
62 changes: 62 additions & 0 deletions
62
src/views/ArticleDetail/EditMode/ConfirmExitDialog/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,62 @@ | ||
import { Dialog, Translate, useDialogSwitch } from '~/components' | ||
|
||
interface ConfirmExitDialogProps { | ||
onExit: () => any | ||
children: ({ open }: { open: () => void }) => React.ReactNode | ||
} | ||
|
||
const ConfirmExitDialog = ({ onExit, children }: ConfirmExitDialogProps) => { | ||
const { show, open, close } = useDialogSwitch(true) | ||
|
||
return ( | ||
<> | ||
{children({ open })} | ||
|
||
<Dialog isOpen={show} onDismiss={close} size="sm"> | ||
<Dialog.Header | ||
title={<Translate zh_hant="修訂須知" zh_hans="修订须知" />} | ||
close={close} | ||
mode="inner" | ||
/> | ||
|
||
<Dialog.Message> | ||
<p> | ||
<Translate | ||
zh_hant="跳出該頁,本次操作不會保存" | ||
zh_hans="跳出该页,本次操作不会保存" | ||
en="You will lost your changes if you leave this page" | ||
/> | ||
</p> | ||
</Dialog.Message> | ||
|
||
<Dialog.Footer> | ||
<Dialog.Footer.Button | ||
bgColor="red" | ||
onClick={() => { | ||
onExit() | ||
close() | ||
}} | ||
> | ||
<Translate id="confirm" /> | ||
</Dialog.Footer.Button> | ||
|
||
<Dialog.Footer.Button | ||
bgColor="grey-lighter" | ||
textColor="black" | ||
onClick={close} | ||
> | ||
<Translate id="cancel" /> | ||
</Dialog.Footer.Button> | ||
</Dialog.Footer> | ||
</Dialog> | ||
</> | ||
) | ||
} | ||
|
||
const LazyConfirmExitDialog = (props: ConfirmExitDialogProps) => ( | ||
<Dialog.Lazy mounted={<ConfirmExitDialog {...props} />}> | ||
{({ open }) => <>{props.children({ open })}</>} | ||
</Dialog.Lazy> | ||
) | ||
|
||
export default LazyConfirmExitDialog |
Oops, something went wrong.