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

A few Improvements #215

Merged
merged 4 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"react-dom": "18.1.0",
"react-highlight": "0.12.0",
"react-modal": "^3.15.1",
"react-scroll-up": "^1.4.0",
"react-simple-linkify": "1.0.3",
"styled-components": "5.3.5"
},
Expand Down
21 changes: 18 additions & 3 deletions src/components/CodeComparison.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,24 @@ const Variant = memo(
<Heading hierarchy="4">
{variant}
{variant == 'plain js' ? (
<button className="button button-clear" onClick={() => openModal(id)}>
see on codesandbox.io
</button>
<>
<button
className="button button-clear"
onClick={() => openModal(id)}
>
codesandbox.io
</button>
<a
href={`https://www.phind.com/search?q=${encodeURIComponent(
methodData[variant]
)}`}
title="Take with a pinch of salt"
target="_blank"
rel="noreferrer noopener"
>
<button className="button button-clear">AI explanation</button>
</a>
</>
) : (
''
)}
Expand Down
7 changes: 7 additions & 0 deletions src/components/LibPage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Fragment, useCallback, useState, memo, useEffect } from 'react'
import ScrollToTop from 'react-scroll-up'
import styled from 'styled-components'
import Content from './ContentBlock'
import AnchoredBlock from './AnchoredBlock'
Expand Down Expand Up @@ -90,6 +91,12 @@ export default memo(({ data: initialData, frw }) => {
</AnchoredBlock>
</Row>
))}

<ScrollToTop style={{ fontSize: 26, bottom: 30 }} showUnder={160}>
<span role="img" aria-label="Go To Top">
🔝
</span>
</ScrollToTop>
<Modal id={embed} close={closeModal} />
</Fragment>
)
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/static-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const getStaticProps = key => {
const siteRoot =
process.env.PULL_REQUEST === 'true'
? process.env.DEPLOY_PRIME_URL
: process.env.URL.replace('http://', 'https://')
: (process.env.URL || '').replace('http://', 'https://')

return {
props: {
Expand Down
37 changes: 32 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1758,9 +1758,9 @@ camelize@^1.0.0:
integrity sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=

caniuse-lite@^1.0.30001332:
version "1.0.30001464"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001464.tgz"
integrity sha512-oww27MtUmusatpRpCGSOneQk2/l5czXANDSFvsc7VuOQ86s3ANhZetpwXNf1zY/zdfP63Xvjz325DAdAoES13g==
version "1.0.30001570"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001570.tgz"
integrity sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw==

capture-stack-trace@^1.0.0:
version "1.0.1"
Expand Down Expand Up @@ -2359,11 +2359,23 @@ delayed-stream@~1.0.0:
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=

detect-it@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/detect-it/-/detect-it-4.0.1.tgz#3f8de6b8330f5086270571251bedf10aec049e18"
integrity sha512-dg5YBTJYvogK1+dA2mBUDKzOWfYZtHVba89SyZUhc4+e3i2tzgjANFg5lDRCd3UOtRcw00vUTMK8LELcMdicug==

detect-newline@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651"
integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==

detect-passive-events@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/detect-passive-events/-/detect-passive-events-2.0.3.tgz#1f75ebf80660a66c615d8be23c3241cdda6977e0"
integrity sha512-QN/1X65Axis6a9D8qg8Py9cwY/fkWAmAH/edTbmLMcv4m5dboLJ7LcAi8CfaCON2tjk904KwKX/HTdsHC6yeRg==
dependencies:
detect-it "^4.0.1"

diff-sequences@^28.0.2:
version "28.0.2"
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-28.0.2.tgz#40f8d4ffa081acbd8902ba35c798458d0ff1af41"
Expand Down Expand Up @@ -5224,7 +5236,7 @@ nwsapi@^2.2.0:
resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7"
integrity sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==

object-assign@^4.1.1:
object-assign@^4.0.1, object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
Expand Down Expand Up @@ -5710,7 +5722,7 @@ prompts@^2.0.1:
kleur "^3.0.3"
sisteransi "^1.0.5"

prop-types@^15.7.2, prop-types@^15.8.1:
prop-types@^15.5.8, prop-types@^15.7.2, prop-types@^15.8.1:
version "15.8.1"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
Expand Down Expand Up @@ -5846,6 +5858,16 @@ react-modal@^3.15.1:
react-lifecycles-compat "^3.0.0"
warning "^4.0.3"

react-scroll-up@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/react-scroll-up/-/react-scroll-up-1.4.0.tgz#2d17ce1b9a92614e5ac6eb63fcb1c07136a2fb48"
integrity sha512-UppnsEams+0bBoSSasSHveYNyOwkoOrFm8jKWvU5SsNSBKji4LL/lF6cdUSHKNdtKaD7wc/d3576Qc+IjNoBxw==
dependencies:
detect-passive-events "^2.0.2"
object-assign "^4.0.1"
prop-types "^15.5.8"
tween-functions "^1.1.0"

[email protected]:
version "1.0.3"
resolved "https://registry.yarnpkg.com/react-simple-linkify/-/react-simple-linkify-1.0.3.tgz#b987594dc160d8364631e62cbd820fdae4d782fb"
Expand Down Expand Up @@ -6804,6 +6826,11 @@ tsutils@^3.21.0:
dependencies:
tslib "^1.8.1"

tween-functions@^1.1.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/tween-functions/-/tween-functions-1.2.0.tgz#1ae3a50e7c60bb3def774eac707acbca73bbc3ff"
integrity sha512-PZBtLYcCLtEcjL14Fzb1gSxPBeL7nWvGhO5ZFPGqziCcr8uvHp0NDmdjBchp6KHL+tExcg0m3NISmKxhU394dA==

type-check@^0.4.0, type-check@~0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1"
Expand Down
Loading