Skip to content

Commit 1ede30e

Browse files
committed
Merge branch 'dev' into feedback-v2
2 parents a7270a9 + a76c2af commit 1ede30e

File tree

43 files changed

+14817
-12639
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+14817
-12639
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ethereum-org-website",
3-
"version": "6.9.2",
3+
"version": "6.9.4",
44
"description": "Website of ethereum.org",
55
"main": "index.js",
66
"repository": "git@github.com:ethereum/ethereum-org-website.git",

src/assets/exchanges/ftx.png

-1.52 KB
Binary file not shown.

src/components/EthExchanges.tsx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ type ExchangeName =
154154
| "coinspot"
155155
| "cryptocom"
156156
| "easycrypto"
157-
| "ftx"
158-
| "ftxus"
159157
| "gateio"
160158
| "gemini"
161159
| "huobiglobal"
@@ -241,8 +239,6 @@ const EthExchanges = () => {
241239
country
242240
cryptocom
243241
easycrypto
244-
ftx
245-
ftxus
246242
gateio
247243
gemini
248244
huobiglobal
@@ -317,12 +313,6 @@ const EthExchanges = () => {
317313
easycrypto: file(relativePath: { eq: "exchanges/easycrypto.png" }) {
318314
...cardListImage
319315
}
320-
ftx: file(relativePath: { eq: "exchanges/ftx.png" }) {
321-
...cardListImage
322-
}
323-
ftxus: file(relativePath: { eq: "exchanges/ftx.png" }) {
324-
...cardListImage
325-
}
326316
gateio: file(relativePath: { eq: "exchanges/gateio.png" }) {
327317
...cardListImage
328318
}
@@ -462,18 +452,6 @@ const EthExchanges = () => {
462452
image: data.easycrypto,
463453
usaExceptions: [],
464454
},
465-
ftx: {
466-
name: "FTX",
467-
url: "https://ftx.com/",
468-
image: data.ftx,
469-
usaExceptions: [],
470-
},
471-
ftxus: {
472-
name: "FTX US",
473-
url: "https://ftx.us/",
474-
image: data.ftx,
475-
usaExceptions: ["NY"],
476-
},
477455
gateio: {
478456
name: "Gate.io",
479457
url: "https://www.gate.io/",

src/components/FeedbackWidget.tsx

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Box, Button, ButtonProps, Flex, Icon, Text } from "@chakra-ui/react"
44
import { useIntl } from "react-intl"
55
import { MdClose } from "react-icons/md"
66
import FocusTrap from "focus-trap-react"
7+
import { Text, ScaleFade, Box } from "@chakra-ui/react"
78
// Component imports
89
import Translation from "./Translation"
910
// SVG imports
@@ -18,16 +19,18 @@ import { useSurvey } from "../hooks/useSurvey"
1819

1920
interface FixedDotProps extends ButtonProps {
2021
bottomOffset: number
22+
isExpanded: boolean
2123
}
2224
const FixedDot: React.FC<FixedDotProps> = ({
2325
children,
2426
bottomOffset,
27+
isExpanded,
2528
...props
2629
}) => {
2730
const size = "3rem"
2831
return (
2932
<Button
30-
w={size}
33+
w={{ base: size, lg: isExpanded ? "15rem" : size }}
3134
h={size}
3235
borderRadius="full"
3336
variant="solid"
@@ -46,7 +49,8 @@ const FixedDot: React.FC<FixedDotProps> = ({
4649
transform: "scale(1.1)",
4750
transition: "transform 0.2s ease-in-out",
4851
}}
49-
transition="transform 0.2s ease-in-out"
52+
transition="transform 0.2s ease-in-out, width 0.25s linear,
53+
border-radius 0.25s linear"
5054
{...props}
5155
>
5256
{children}
@@ -62,12 +66,18 @@ const FeedbackWidget: React.FC<FeedbackWidgetProps> = ({ location = "" }) => {
6266
const containerRef = useRef<HTMLInputElement>(null)
6367
useOnClickOutside(containerRef, () => handleClose(), [`mousedown`])
6468
const [isOpen, setIsOpen] = useState<boolean>(false)
69+
const [isExpanded, setIsExpanded] = useState<boolean>(false)
6570
const [feedbackSubmitted, setFeedbackSubmitted] = useState<boolean>(false)
6671

6772
useEffect(() => {
6873
// Reset component state when path (location) changes
6974
setIsOpen(false)
7075
setFeedbackSubmitted(false)
76+
setIsExpanded(false)
77+
78+
let expandTimeout = setTimeout(() => setIsExpanded(true), 30000)
79+
80+
return () => clearTimeout(expandTimeout)
7181
}, [location])
7282

7383
const surveyUrl = useSurvey(feedbackSubmitted)
@@ -86,6 +96,7 @@ const FeedbackWidget: React.FC<FeedbackWidgetProps> = ({ location = "" }) => {
8696

8797
const handleClose = (): void => {
8898
setIsOpen(false)
99+
setIsExpanded(false)
89100
trackCustomEvent({
90101
eventCategory: `FeedbackWidget toggled`,
91102
eventAction: `Clicked`,
@@ -116,6 +127,7 @@ const FeedbackWidget: React.FC<FeedbackWidgetProps> = ({ location = "" }) => {
116127
})
117128
window && surveyUrl && window.open(surveyUrl, "_blank")
118129
setIsOpen(false) // Close widget without triggering redundant tracker event
130+
setIsExpanded(false)
119131
}
120132

121133
useKeyPress(`Escape`, handleClose)
@@ -124,8 +136,38 @@ const FeedbackWidget: React.FC<FeedbackWidgetProps> = ({ location = "" }) => {
124136
const closeButtonSize = "24px"
125137
return (
126138
<>
127-
<FixedDot onClick={handleOpen} bottomOffset={bottomOffset} id="dot">
128-
<Icon as={FeedbackGlyph} color="white" h="32px" w="26px" />
139+
<FixedDot
140+
onClick={handleOpen}
141+
bottomOffset={bottomOffset}
142+
isExpanded={isExpanded}
143+
id="dot"
144+
>
145+
<Box
146+
display="flex"
147+
justifyContent="space-evenly"
148+
width={{ base: "3rem", lg: isExpanded ? "13.5rem" : "3rem" }}
149+
position={{
150+
base: "inherit",
151+
lg: isExpanded ? "absolute" : "inherit",
152+
}}
153+
>
154+
<Icon as={FeedbackGlyph} color="white" h="32px" w="26px" my="11px" />
155+
{isExpanded && (
156+
<ScaleFade in={isExpanded} delay={0.25}>
157+
<Text
158+
as="div"
159+
color="white"
160+
fontWeight="bold"
161+
noOfLines={2}
162+
height="100%"
163+
alignItems="center"
164+
display={{ base: "none", lg: isExpanded ? "flex" : "none" }}
165+
>
166+
<Translation id="feedback-card-prompt-page" />
167+
</Text>
168+
</ScaleFade>
169+
)}
170+
</Box>
129171
</FixedDot>
130172
{isOpen && (
131173
<Box

src/components/Layout.tsx

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { LocaleProvider } from "gatsby-theme-i18n"
99
import { lightTheme, darkTheme } from "../theme"
1010

1111
import Footer from "./Footer"
12-
import VisuallyHidden from "./VisuallyHidden"
12+
import ZenMode from "./ZenMode"
1313
import Nav from "./Nav"
1414
import SideNav from "./SideNav"
1515
import SideNavMobile from "./SideNavMobile"
@@ -148,43 +148,41 @@ const Layout: React.FC<IProps> = ({
148148
<IntlProvider locale={locale!} key={locale} messages={messages}>
149149
<ApolloProvider client={client}>
150150
<ThemeProvider theme={theme}>
151-
<SkipLink hrefId="#main-content" />
152-
<TranslationBanner
153-
shouldShow={shouldShowTranslationBanner}
154-
isPageContentEnglish={isPageContentEnglish}
155-
isPageRightToLeft={isPageRightToLeft}
156-
originalPagePath={pageContext.originalPath!}
157-
/>
158-
<TranslationBannerLegal
159-
shouldShow={isLegal}
160-
isPageRightToLeft={isPageRightToLeft}
161-
originalPagePath={pageContext.originalPath!}
162-
/>
163-
<ContentContainer>
164-
<VisuallyHidden isHidden={isZenMode}>
165-
<Nav path={path} />
166-
{shouldShowSideNav && <SideNavMobile path={path} />}
167-
</VisuallyHidden>
168-
<SkipLinkAnchor id="main-content" />
169-
<MainContainer>
170-
{shouldShowSideNav && (
171-
<VisuallyHidden isHidden={isZenMode}>
172-
<SideNav path={path} />
173-
</VisuallyHidden>
174-
)}
175-
<MainContent>
176-
<ZenModeContext.Provider
177-
value={{ isZenMode, handleZenModeChange }}
178-
>
151+
<ZenModeContext.Provider value={{ isZenMode, handleZenModeChange }}>
152+
<SkipLink hrefId="#main-content" />
153+
<TranslationBanner
154+
shouldShow={shouldShowTranslationBanner}
155+
isPageContentEnglish={isPageContentEnglish}
156+
isPageRightToLeft={isPageRightToLeft}
157+
originalPagePath={pageContext.originalPath!}
158+
/>
159+
<TranslationBannerLegal
160+
shouldShow={isLegal}
161+
isPageRightToLeft={isPageRightToLeft}
162+
originalPagePath={pageContext.originalPath!}
163+
/>
164+
<ContentContainer>
165+
<ZenMode>
166+
<Nav path={path} />
167+
{shouldShowSideNav && <SideNavMobile path={path} />}
168+
</ZenMode>
169+
<SkipLinkAnchor id="main-content" />
170+
<MainContainer>
171+
{shouldShowSideNav && (
172+
<ZenMode>
173+
<SideNav path={path} />
174+
</ZenMode>
175+
)}
176+
<MainContent>
179177
<Main>{children}</Main>
180-
</ZenModeContext.Provider>
181-
</MainContent>
182-
</MainContainer>
183-
<VisuallyHidden isHidden={isZenMode}>
184-
<Footer />
185-
</VisuallyHidden>
186-
<FeedbackWidget location={path} />
187-
</ContentContainer>
178+
</MainContent>
179+
</MainContainer>
180+
<ZenMode>
181+
<Footer />
182+
</ZenMode>
183+
<FeedbackWidget location={path} />
184+
</ContentContainer>
185+
</ZenModeContext.Provider>
188186
</ThemeProvider>
189187
</ApolloProvider>
190188
</IntlProvider>

src/components/Pill.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const Pill: React.FC<IProps> = ({
3333
</Flex>
3434
) : (
3535
<Flex
36-
backgroundColor={color ? color : "primary"}
36+
backgroundColor={color ? color : "primary100"}
3737
display="inline-block"
3838
color="black300"
3939
textTransform="uppercase"

src/components/Quiz/QuizWidget.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,7 @@ const QuizWidget: React.FC<IProps> = ({ quizKey, maxQuestions }) => {
171171
eventCategory: "Quiz widget",
172172
eventAction: "Question answered",
173173
eventName: `QID: ${questionId}`,
174-
eventValue: answer.isCorrect
175-
? `Correct answer`
176-
: `AID: ${answer.answerId}`,
174+
eventValue: answer.isCorrect ? "1" : "0",
177175
})
178176
setShowAnswer(true)
179177
}

0 commit comments

Comments
 (0)