-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
261 changed files
with
722,410 additions
and
127,862 deletions.
There are no files selected for viewing
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,43 +1,63 @@ | ||
{ | ||
"extends": ["next/core-web-vitals", "airbnb", "airbnb-typescript"], | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
}, | ||
"rules": { | ||
"indent": ["error", 4, { "SwitchCase": 1 }], | ||
"no-param-reassign": ["error", { "props": false }], | ||
"no-plusplus": "off", | ||
"implicit-arrow-linebreak": "off", | ||
"extends": [ | ||
"next/core-web-vitals", | ||
"plugin:prettier/recommended", | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:jsx-a11y/recommended", | ||
"plugin:react-hooks/recommended" | ||
], | ||
"ignorePatterns": ["next.config.js", "scripts/**/*.*js"], | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
}, | ||
"rules": { | ||
"@next/next/no-img-element": "off", | ||
|
||
"@typescript-eslint/indent": ["error", 4], | ||
// TODO: remove this rule | ||
"@typescript-eslint/no-explicit-any": "off", | ||
// TODO: remove this rule | ||
"@typescript-eslint/ban-ts-comment": "off", | ||
// TODO: remove this rule | ||
"jsx-a11y/click-events-have-key-events": "off", | ||
// TODO: remove this rule | ||
"jsx-a11y/no-static-element-interactions": "off", | ||
|
||
"react/jsx-indent": ["error", 4], | ||
"react/jsx-indent-props": ["error", 4], | ||
"react/jsx-props-no-spreading": "off", | ||
"react/jsx-filename-extension": [1, { "extensions": [".tsx"] }], | ||
"react/require-default-props": "off", | ||
"react/jsx-no-useless-fragment": "off", | ||
"react/jsx-one-expression-per-line": "off", | ||
"react/react-in-jsx-scope": "off", | ||
|
||
"import/extensions": ["error", "never", { "svg": "always", "json": "always", "css": "always" }], | ||
"import/prefer-default-export": "off", | ||
"import/order": [ | ||
"error", | ||
{ | ||
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"] | ||
} | ||
], | ||
"no-irregular-whitespace": "off", | ||
"no-restricted-imports": [ | ||
"error", | ||
{ | ||
"patterns": [ | ||
{ | ||
"group": ["../../"], | ||
"message": "Relative imports are not allowed." | ||
} | ||
] | ||
} | ||
], | ||
|
||
"import/order": [ | ||
"error", | ||
{ | ||
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"] | ||
} | ||
], | ||
|
||
"jsx-a11y/click-events-have-key-events": "off", | ||
"jsx-a11y/no-static-element-interactions": "off", | ||
"object-curly-newline": "off", | ||
"@next/next/no-img-element": "off", | ||
"max-len": "off", | ||
"function-paren-newline": "off", | ||
"operator-linebreak": "off", | ||
"linebreak-style": "off" | ||
|
||
}, | ||
"ignorePatterns": ["next.config.js", "scripts/**/*.*js"] | ||
"import/no-restricted-paths": [ | ||
"error", | ||
{ | ||
"zones": [ | ||
// separate ui and logic | ||
{ "from": "./constants", "target": "./shared" }, | ||
{ "from": "./state", "target": "./shared" }, | ||
{ "from": "./components", "target": "./shared" }, | ||
{ "from": "./features", "target": "./shared" }, | ||
{ "from": "./pages", "target": "./shared" }, | ||
{ "from": "./types", "target": "./shared" }, | ||
{ "from": "./state", "target": "./components" }, | ||
{ "from": "./features", "target": "./components" } | ||
] | ||
} | ||
] | ||
} | ||
} |
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,41 +1,41 @@ | ||
name: Vercel Deploy | ||
on: [push] | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Extract branch name | ||
id: extract_branch | ||
run: | | ||
branch_name=${GITHUB_REF#refs/heads/} | ||
branch_formatted=${branch_name//\//-} | ||
echo $branch_name | ||
echo $branch_formatted | ||
echo ::set-output name=branch::$branch_formatted | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Extract branch name | ||
id: extract_branch | ||
run: | | ||
branch_name=${GITHUB_REF#refs/heads/} | ||
branch_formatted=${branch_name//\//-} | ||
echo $branch_name | ||
echo $branch_formatted | ||
echo ::set-output name=branch::$branch_formatted | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Deploy to Staging | ||
id: deploy-vercel-staging | ||
uses: amondnet/vercel-action@v20 | ||
if: github.ref != 'refs/heads/main' | ||
with: | ||
vercel-token: ${{secrets.VERCEL_TOKEN}} | ||
github-token: ${{secrets.VERCEL_GITHUB_TOKEN}} | ||
vercel-org-id: ${{secrets.VERCEL_ORG_ID}} | ||
vercel-project-id: ${{secrets.VERCEL_PROJECT_ID}} | ||
alias-domains: >- | ||
${{ format( | ||
'{0}-{1}.vercel.app', | ||
secrets.VERCEL_DOMAIN, | ||
steps.extract_branch.outputs.branch) | ||
}} | ||
- name: Deploy to Production | ||
id: deploy-vercel-production | ||
uses: amondnet/vercel-action@v20 | ||
if: github.ref == 'refs/heads/main' | ||
with: | ||
vercel-token: ${{secrets.VERCEL_TOKEN}} | ||
vercel-org-id: ${{secrets.VERCEL_ORG_ID}} | ||
vercel-project-id: ${{secrets.VERCEL_PROJECT_ID}} | ||
vercel-args: "--prod" | ||
- name: Deploy to Staging | ||
id: deploy-vercel-staging | ||
uses: amondnet/vercel-action@v20 | ||
if: github.ref != 'refs/heads/main' | ||
with: | ||
vercel-token: ${{secrets.VERCEL_TOKEN}} | ||
github-token: ${{secrets.VERCEL_GITHUB_TOKEN}} | ||
vercel-org-id: ${{secrets.VERCEL_ORG_ID}} | ||
vercel-project-id: ${{secrets.VERCEL_PROJECT_ID}} | ||
alias-domains: >- | ||
${{ format( | ||
'{0}-{1}.vercel.app', | ||
secrets.VERCEL_DOMAIN, | ||
steps.extract_branch.outputs.branch) | ||
}} | ||
- name: Deploy to Production | ||
id: deploy-vercel-production | ||
uses: amondnet/vercel-action@v20 | ||
if: github.ref == 'refs/heads/main' | ||
with: | ||
vercel-token: ${{secrets.VERCEL_TOKEN}} | ||
vercel-org-id: ${{secrets.VERCEL_ORG_ID}} | ||
vercel-project-id: ${{secrets.VERCEL_PROJECT_ID}} | ||
vercel-args: '--prod' |
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 |
---|---|---|
|
@@ -11,7 +11,7 @@ module.exports = { | |
{ | ||
files: ['*.json', '*.yaml'], | ||
options: { | ||
tabWidth: 2, | ||
tabWidth: 4, | ||
}, | ||
}, | ||
], | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React, { useEffect, useMemo, useState } from 'react'; | ||
import { CardLoader } from 'components/Card/components/Loader/Loader'; | ||
import { ContentConfig, MapItemType } from 'types/Content.types'; | ||
|
||
interface Props { | ||
contentConfig: ContentConfig; | ||
popupId?: string; | ||
popupType: MapItemType | null; | ||
} | ||
|
||
export function Card({ contentConfig, popupId, popupType }: Props) { | ||
const [popupData, setPopupData] = useState<any>(); | ||
const [loading, setLoading] = useState<boolean>(false); | ||
|
||
useEffect(() => { | ||
async function fetchData() { | ||
if (!popupId || !popupType) { | ||
return; | ||
} | ||
|
||
setLoading(true); | ||
|
||
const requestFunction = contentConfig[popupType].oneItemRequest; | ||
|
||
const data = await requestFunction(popupId); | ||
|
||
setPopupData(data); | ||
setLoading(false); | ||
} | ||
|
||
fetchData(); | ||
}, [contentConfig, popupId, popupType]); | ||
|
||
const CardContent = useMemo(() => { | ||
setLoading(true); | ||
|
||
return contentConfig[popupType]?.cardContent || (() => null); | ||
}, [contentConfig, popupType]); | ||
|
||
return loading ? <CardLoader /> : <CardContent placemark={popupData} />; | ||
} |
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
Oops, something went wrong.