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

PRODUCTION PUSH: Tweet & Tables in Story Editor, bugfixes & improvements #1131

Merged
merged 72 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
01145a5
fix: add more pwa icons
sajald77 Aug 17, 2023
5723eb2
fix: add new script for upstream running, dev-stage
sajald77 Aug 18, 2023
5cff146
fix: qr code flickering issue
sajald77 Aug 18, 2023
aa3889c
fix: add loader till the success component is loaded
sajald77 Aug 18, 2023
d100627
fix: reconnection for subscriptions
sajald77 Aug 18, 2023
4cfa6ea
fix: add stuff to readme.md about dev:stage
sajald77 Aug 22, 2023
96ce2f1
Merge pull request #1113 from geyserfund/fix/success-screen-issues
sajald77 Aug 22, 2023
664859c
fix: markdown table in WIP
sajald77 Aug 23, 2023
fbd1df9
fix: in progress
sajald77 Aug 23, 2023
350a9d2
fix: finalize table feature for story markdown editor and viewer
sajald77 Aug 24, 2023
3b02573
fix: insert hardbreak after images and videos
sajald77 Aug 24, 2023
e46b51b
fix: issues with markdown and add multi line feature
sajald77 Aug 24, 2023
bc25d9b
fix: finalize video fixes and sanitize html
sajald77 Aug 25, 2023
d4628d5
fix: add twitter embed inside markdown
sajald77 Aug 26, 2023
2857ac7
fix: type issue
sajald77 Aug 26, 2023
b5a82e1
chore: create menu item as separate component
sajald77 Aug 26, 2023
74a7cbf
fix: use row count and column count constants instead of array constant
sajald77 Aug 26, 2023
0c4ef54
fix: add error handling around twttr widgets
sajald77 Aug 26, 2023
9eb009c
fix: update icons to better quality
sajald77 Aug 26, 2023
2868e1c
Merge branch 'staging' into fix/add-pwa-icons
sajald77 Aug 26, 2023
267fafa
Merge branch 'main' into staging
sajald77 Aug 27, 2023
7b9c261
Merge branch 'staging' into feat/markdown-tables
sajald77 Aug 27, 2023
569f1c2
fix: remove unhandled rejection error from bitcoin api
sajald77 Aug 27, 2023
01b2722
Merge pull request #1116 from geyserfund/feat/markdown-tables
sajald77 Aug 27, 2023
423011c
Merge pull request #1112 from geyserfund/fix/add-pwa-icons
sajald77 Aug 27, 2023
1cfb1ec
fix: allow value to be set to 0
sajald77 Aug 27, 2023
5840dfb
fix: layout of distribution chart
sajald77 Aug 27, 2023
5214843
Merge pull request #1118 from geyserfund/sajal/GEY-3294-grant-4-layou…
sajald77 Aug 27, 2023
a967c97
fix: update circle progress colors so that they are more contrasting
sajald77 Aug 27, 2023
d3e9f50
fix: update button to include currency conversion
sajald77 Aug 28, 2023
b77339c
fix: show less than one for dollar
sajald77 Aug 28, 2023
8a1223e
fix: map issue
sajald77 Aug 28, 2023
512c9ac
fix: remove nostr from mobile login
sajald77 Aug 28, 2023
4c6d46c
fix: error of <p> with <p>
sajald77 Aug 28, 2023
aa020e1
fix: no key for mapped jsx
sajald77 Aug 28, 2023
c34ec36
fix: update launch project icons
sajald77 Aug 28, 2023
b81c308
fix: change contribute icon to lightning icon, resolves GEY-3322
sajald77 Aug 28, 2023
d859356
fix: safari issues
sajald77 Aug 28, 2023
0c082d5
feat: add scripts for trusting caddy local CA
steliosrammos Aug 28, 2023
c76640c
Merge branch 'main' into staging
sajald77 Aug 28, 2023
5b5d0c6
fix: update tweetid extraction and copy updates
sajald77 Aug 28, 2023
86c35d0
fix: table fix WIP
sajald77 Aug 29, 2023
99c50fa
Merge pull request #1117 from geyserfund/sajal/GEY-3368-donation-amou…
sajald77 Aug 29, 2023
c5f172b
Merge pull request #1121 from geyserfund/sajal/GEY-3374-remove-nostr-…
sajald77 Aug 29, 2023
8d59fe2
Merge pull request #1122 from geyserfund/sajal/GEY-3366-update-launch…
sajald77 Aug 29, 2023
f722a94
fix: use tab for going to the next place instead of indenting
sajald77 Aug 29, 2023
8c6b2c0
fix: minor style fix
sajald77 Aug 29, 2023
d8e6aa2
fix: same behavior towards tabs
sajald77 Aug 29, 2023
f96c827
fix: add onclick for table button
sajald77 Aug 29, 2023
2cd0bfb
Merge branch 'staging' into sajal/GEY-3200-project-balance-currency-c…
sajald77 Aug 29, 2023
6b7c122
fix: use the whole balance summary unit as a button
sajald77 Aug 29, 2023
2c9cf8a
Merge pull request #1119 from geyserfund/sajal/GEY-3200-project-balan…
sajald77 Aug 29, 2023
0022ce5
fix: remove status active when search is active
sajald77 Aug 30, 2023
62a1982
Update scripts/trust-caddy-cert.sh
steliosrammos Aug 30, 2023
70b6473
fix: update geyser grants gaq url
sajald77 Aug 30, 2023
6171bbf
fix: update launch rocket image
sajald77 Aug 30, 2023
4730721
fix: close tooltip after 1.5 seconds
sajald77 Aug 30, 2023
bb2d596
Merge pull request #1125 from geyserfund/fix/markdown-tweet-fix
sajald77 Aug 30, 2023
daa8173
Merge branch 'staging' into sajal/GEY-3162-Search-inactive-as-well
sajald77 Aug 30, 2023
580d5c8
Merge pull request #1123 from geyserfund/feat/trust-caddy-local-ca-sc…
steliosrammos Aug 30, 2023
9d17b13
Merge pull request #1128 from geyserfund/sajal/GEY-3162-Search-inacti…
sajald77 Aug 30, 2023
07b5d21
fix: add login in public comment section
sajald77 Aug 30, 2023
f6e4bc3
Merge pull request #1130 from geyserfund/sajal/GEY-3162-Search-inacti…
sajald77 Aug 30, 2023
1706897
Update Arabic.json (POEditor.com)
sajald77 Aug 30, 2023
e06d472
Update Chinese.json (POEditor.com)
sajald77 Aug 30, 2023
2db5d51
Update Czech.json (POEditor.com)
sajald77 Aug 30, 2023
4d26423
Update French.json (POEditor.com)
sajald77 Aug 30, 2023
c99d795
Update German.json (POEditor.com)
sajald77 Aug 30, 2023
7ca4009
Update Greek.json (POEditor.com)
sajald77 Aug 30, 2023
d7a0b74
Update Italian.json (POEditor.com)
sajald77 Aug 30, 2023
b43a802
Update Polish.json (POEditor.com)
sajald77 Aug 30, 2023
0a1fc88
fix: update changelog and package version
sajald77 Aug 30, 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
.env.development.local
.env.test.local
.env.production.local
.env.staging
.env

npm-debug.log*
Expand All @@ -29,3 +30,5 @@ yarn-error.log*

faker/custom-extended-schemas/
src/config/apollo-client/customClientTypeDefs.ts

caddy/certificate/root.crt
378 changes: 378 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The app requires some environment variables to be set. We provide an `example.en
cp .env.example .env
```

From there, populate the new file with the correct values. You have two development environment options:
From there, populate the new file with the correct values. You have three development environment options, detailed below. It is recommended to use the staging API for most development tasks.

#### Option A: use the staging API

Expand All @@ -49,16 +49,29 @@ REACT_APP_API_ENDPOINT=https://api.dev.geyser.fund
APOLLO_KEY=<your Apollo Studio API key>
```

[Contact us](email:[email protected]) if you don't have an `APOLLO_KEY` yet.
[Contact us](email:[email protected]) if you don't have an `APOLLO_KEY` yet.

#### Option C: use both local server and staging API interchangably

Many at times we prefer using staging API while sometimes we prefer the local server. In such cases we can setup to use them interchangably.

1. Create the normal `.env` file, which contains the values for local server. This would be used when we command `yarn dev`.
2. Create a new file `.env.staging` this would have the values to use the staging API, and use the command `yarn dev:stage` to use the staging server env values.

### Hosts Configuration

#### Staging API

In order for the requests to go through to the staging backend API, you will need to add the following line to your `/etc/hosts` file:

```shell
127.0.0.1 staging.geyser.fund
```

This makes sure that you are able to make requests to the staging API from your local development environment with encountering CORS errors.

#### GraphQL Faker

If running against the GraphQL Faker server, you'll also need these in the same `/etc/hosts` file:

```shell
Expand Down Expand Up @@ -94,6 +107,18 @@ or
docker-compose logs -f geyser-app
```

### Trusting Caddy Local CA Certificate

We are using Caddy as a reverse proxy to serve the local development app over HTTPS. This means that you will need to trust the Caddy Local CA Certificate in order to avoid any `ERR_CERT_AUTHORITY_INVALID` errors in your browser.

To do so, you can run the following command from the project root directory **after starting the app and caddy server**:

```shell
sudo yarn caddy:trust-ca
```

This command will add the Caddy Local CA Certificate to your system's list of trusted certificates (only works on MacOS for now). It needs sudo rights for that.

### Opening in the Browser

With Docker running, navigate to the URL that's appropriate for the development-environment configuration in your `.env` file:
Expand Down
1 change: 1 addition & 0 deletions caddy/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ api.dev.geyser.fund {
reverse_proxy graphql-faker:9002
}

# Local deployment with staging api
staging.geyser.fund {
tls internal
reverse_proxy geyser-app-standalone:3000
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ services:
context: .
target: base
command: sh -c "RUN_DOCKER=true && yarn install && yarn dev"
depends_on:
- caddy
working_dir: /usr/app
image: geyser-app
env_file: .env
Expand Down
16 changes: 16 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@
a.appendChild(r);
})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
</script>
<script>window.twttr = (function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0],
t = window.twttr || {};
if (d.getElementById(id)) return t;
js = d.createElement(s);
js.id = id;
js.src = "https://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs);

t._e = [];
t.ready = function(f) {
t._e.push(f);
};

return t;
}(document, "script", "twitter-wjs"));</script>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "geyser-app",
"private": true,
"version": "0.5.0",
"version": "0.5.1",
"scripts": {
"dev": "vite",
"dev:stage": "vite --mode staging",
"build": "tsc && vite build",
"preview": "vite preview --port 3000",
"test:e2e": "yarn cypress run --e2e",
Expand All @@ -17,6 +18,7 @@
"graph:fetch": "run(){ rover graph fetch geyser-graph@$1 > ./schema.graphql; }; run",
"graph:generate": "run(){ yarn graph:fetch $1 && graphql-codegen --config codegen.ts && rm schema.graphql && yarn graph:format; }; run",
"graph:generate:staging": "yarn graph:generate staging",
"caddy:trust-ca": "bash ./scripts/trust-caddy-cert.sh",
"changelog": "yarn conventional-changelog -p conventionalcommits -i CHANGELOG.md -s"
},
"dependencies": {
Expand All @@ -31,6 +33,7 @@
"@hookform/resolvers": "^3.1.0",
"@loadable/component": "^5.15.3",
"@react-hookz/web": "^23.0.0",
"@remirror/extension-node-formatting": "^2.0.13",
"@remirror/pm": "^2.0.5",
"@remirror/react": "^2.0.28",
"@remirror/react-components": "^2.1.12",
Expand All @@ -40,6 +43,7 @@
"bech32": "^2.0.0",
"buffer": "^6.0.3",
"classnames": "^2.3.2",
"dompurify": "^3.0.5",
"dotenv": "^16.0.3",
"express": "^4.18.2",
"framer-motion": "^8.5.2",
Expand Down Expand Up @@ -96,6 +100,7 @@
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.4.3",
"@types/dompurify": "^3.0.2",
"@types/loadable__component": "^5.13.4",
"@types/luxon": "^3.2.0",
"@types/node": "^18.11.18",
Expand Down
Binary file added public/icons/120.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 removed public/icons/128-padded.png
Binary file not shown.
Binary file removed public/icons/16.png
Binary file not shown.
Binary file added public/icons/180-padded.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 removed public/icons/180.png
Binary file not shown.
Binary file modified public/icons/192-maskable.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 modified public/icons/192.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 removed public/icons/32.png
Binary file not shown.
Binary file modified public/icons/512-maskable.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 modified public/icons/512-padded.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/icons/60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions scripts/trust-caddy-cert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
if security find-certificate -c "Caddy Local Authority" -p >> /dev/null; then
echo 'Caddy Local Authority is trusted.'
else
echo 'Adding Caddy Local Authority to KeyChain.'
mkdir -p ./caddy/certificate/
CERT_FILE=./caddy/certificate/root.crt
docker exec geyser-caddy-standalone cat /data/caddy/pki/authorities/local/root.crt > $CERT_FILE
security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain $CERT_FILE
fi;
5 changes: 3 additions & 2 deletions src/components/molecules/AuthModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useAuthContext } from '../../context'
import { ConnectWithLightning } from '../../pages/auth/ConnectWithLightning'
import { ConnectWithNostr } from '../../pages/auth/ConnectWithNostr'
import { ConnectWithTwitter } from '../../pages/auth/ConnectWithTwitter'
import { hasNostrAccount, hasTwitterAccount } from '../../utils'
import { hasNostrAccount, hasTwitterAccount, useMobileMode } from '../../utils'
import { Caption } from '../typography'
import { ButtonComponent } from '../ui'

Expand Down Expand Up @@ -67,6 +67,7 @@ const ConnectAccounts = ({

export const AuthModal = (authModalProps: IAuthModal) => {
const { t } = useTranslation()
const isMobile = useMobileMode()
const {
isOpen,
onClose,
Expand Down Expand Up @@ -124,7 +125,7 @@ export const AuthModal = (authModalProps: IAuthModal) => {
)}
<ConnectAccounts
onClose={onClose}
showNostr={showNostr}
showNostr={showNostr && !isMobile}
showTwitter={showTwitter}
showLightning={showLightning}
/>
Expand Down
12 changes: 9 additions & 3 deletions src/components/molecules/DonationInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ export const DonationInput = ({
const val = Number(value)

if (!val) {
setDollar(0)
setSatoshi(0)
return
}

Expand Down Expand Up @@ -135,7 +137,6 @@ export const DonationInput = ({
}

const fontSize = { base: 'sm', md: 'md', lg: 'sm', xl: 'md' }

return (
<VStack>
<HStack width="100%" justifyContent="space-around" mt="5px">
Expand Down Expand Up @@ -224,8 +225,13 @@ export const DonationInput = ({
>
{isSatoshi ? (
<>
<BiDollar style={{ paddingBottom: '3px' }} />
<MonoBody1 isTruncated>{commaFormatted(dollar) || 0}</MonoBody1>
<MonoBody1 isTruncated>
{dollar > 0
? `$${commaFormatted(dollar)}`
: satoshi > 0
? '< $1'
: '$0'}
</MonoBody1>
</>
) : (
<>
Expand Down
4 changes: 2 additions & 2 deletions src/components/nav/NavBarLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ export const NavBarLogo = ({
{useFullOne ? (
<GeyserLogoNameIcon
height="32px"
width="100%"
width="auto"
color={color || 'primary.400'}
/>
) : (
<GeyserLogoIcon
height="32px"
width="100%"
width="auto"
color={color || 'primary.400'}
/>
)}
Expand Down
11 changes: 2 additions & 9 deletions src/components/nav/bottomNav/LandingNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next'
import { Link, matchPath, matchRoutes, useLocation } from 'react-router-dom'

import { getPath } from '../../../constants'
import { BottomNavContainerCommonStyles } from '../../../constants/styles'
import {
FeedNavIcon,
GrantsNavIcon,
Expand Down Expand Up @@ -79,18 +80,10 @@ export const LandingNavBar = () => {
<>
<Box height="60px" width="100%"></Box>
<HStack
backgroundColor="neutral.50"
width="100%"
height="60px"
borderTop="2px solid"
borderTopColor="neutral.200"
paddingX="15%"
justifyContent="center"
alignItems="center"
spacing="20%"
position="fixed"
bottom="0px"
paddingBottom="8px"
{...BottomNavContainerCommonStyles}
>
{LandingNavItems.map(({ name, path, Icon }) => {
const isActive = Boolean(matchPath(path, location.pathname))
Expand Down
51 changes: 51 additions & 0 deletions src/config/apollo-client/apolloClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,60 @@ const httpLink = createHttpLink({

const prefix = __development__ ? 'ws' : 'wss'

let restartRequestedBeforeConnected = false
let gracefullyRestart = () => {
restartRequestedBeforeConnected = true
}

let activeSocket: WebSocket | null = null
let timedOut = 0

const closeSocket = (socket: WebSocket | null) => {
if (socket?.readyState === WebSocket?.OPEN) {
socket?.close(4408, 'Request Timeout')
}
}

const wsLink = new GraphQLWsLink(
createClient({
url: `${prefix}://${API_SERVICE_ENDPOINT.split('//')[1]}/graphql`,
retryAttempts: Infinity,
shouldRetry: () => true,
keepAlive: 10000,
on: {
error() {
if (activeSocket) {
closeSocket(activeSocket)
}
},
connected(socket: any) {
activeSocket = socket // save the active socket for later use
// restart by closing the socket which will trigger a silent reconnect
gracefullyRestart = () => {
closeSocket(socket)
}

// if any restarts were missed during the connection
// phase, restart and reset the request
if (restartRequestedBeforeConnected) {
restartRequestedBeforeConnected = false
gracefullyRestart()
}
},
ping(received) {
if (!received) {
// sent
timedOut = setTimeout(() => {
closeSocket(activeSocket)
}, 5000)
} // wait 5 seconds for the pong and then close the connection
},
pong(received) {
if (received) {
clearTimeout(timedOut)
} // pong is received, clear connection close timeout
},
},
}),
)

Expand Down
14 changes: 14 additions & 0 deletions src/config/theme/popOverTheme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { popoverAnatomy } from '@chakra-ui/anatomy'
import { createMultiStyleConfigHelpers } from '@chakra-ui/react'

const { definePartsStyle, defineMultiStyleConfig } =
createMultiStyleConfigHelpers(popoverAnatomy.keys)

const baseStyle = definePartsStyle({
body: {
bg: 'neutral.0',
borderRadius: '8px',
},
})

export const popOverTheme = defineMultiStyleConfig({ baseStyle })
2 changes: 2 additions & 0 deletions src/config/theme/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { alertTheme } from './alertTheme'
import { drawerTheme } from './drawerTheme'
import { menuTheme } from './menuTheme'
import { modalTheme } from './modalTheme'
import { popOverTheme } from './popOverTheme'

export const theme = {
initialColorMode: 'system',
Expand Down Expand Up @@ -247,6 +248,7 @@ export const theme = {
Menu: menuTheme,
Modal: modalTheme,
Drawer: drawerTheme,
Popover: popOverTheme,
Input: {
defaultProps: {
focusBorderColor: 'primary.400',
Expand Down
5 changes: 5 additions & 0 deletions src/constants/components/id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ export const ID = {
contribution: 'project-activity-list-container',
leaderboard: 'project-leaderboard-list-container',
},
story: {
markdown: {
container: 'project-story-markdown-container',
},
},
},
profile: {
tabs: 'user-profile-tab-container',
Expand Down
Loading