Skip to content

Commit

Permalink
tabs indent 4 -> 2
Browse files Browse the repository at this point in the history
  • Loading branch information
gcor committed Dec 27, 2023
1 parent 335bac0 commit 88aec05
Show file tree
Hide file tree
Showing 236 changed files with 727,585 additions and 719,098 deletions.
112 changes: 56 additions & 56 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
{
"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",
"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",

// 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",
// 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",

"no-irregular-whitespace": "off",
"no-restricted-imports": [
"error",
{
"patterns": [
{
"group": ["../../"],
"message": "Relative imports are not allowed."
}
]
}
],
"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"]
}
],
"import/order": [
"error",
{
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"]
}
],

"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" }
"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" }
]
}
]
}
]
}
}
}
74 changes: 37 additions & 37 deletions .github/workflows/vercel-deploy.yml
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'
8 changes: 4 additions & 4 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const path = require('path');

const buildEslintCommand = (filenames) =>
`next lint --fix --file ${filenames
.map((f) => path.relative(process.cwd(), f))
.join(' --file ')}`;
`next lint --fix --file ${filenames
.map((f) => path.relative(process.cwd(), f))
.join(' --file ')}`;

module.exports = {
'*.{js,jsx,ts,tsx}': ['prettier --write', buildEslintCommand],
'*.{js,jsx,ts,tsx}': ['prettier --write', buildEslintCommand],
};
32 changes: 16 additions & 16 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
module.exports = {
printWidth: 100,
trailingComma: 'all',
useTabs: false,
singleQuote: true,
tabWidth: 2,
semi: true,
bracketSpacing: true,
bracketSameLine: false,
overrides: [
{
files: ['*.json', '*.yaml'],
options: {
tabWidth: 2,
},
},
],
printWidth: 100,
trailingComma: 'all',
useTabs: false,
singleQuote: true,
tabWidth: 4,
semi: true,
bracketSpacing: true,
bracketSameLine: false,
overrides: [
{
files: ['*.json', '*.yaml'],
options: {
tabWidth: 4,
},
},
],
};
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ The map contains layers of data about objects in the city so that urbanists can

### Features

- Speed and performance map with [Maplibre GL](https://github.com/maplibre/maplibre-gl-js) and [React-mapbox-gl](https://github.com/alex3165/react-mapbox-gl)
- Visualization for [Ekaterinburg opendata](https://github.com/ekaterinburgdev/map-api)
- Detailed object cards
- Speed and performance map with [Maplibre GL](https://github.com/maplibre/maplibre-gl-js) and [React-mapbox-gl](https://github.com/alex3165/react-mapbox-gl)
- Visualization for [Ekaterinburg opendata](https://github.com/ekaterinburgdev/map-api)
- Detailed object cards

## Map data

Expand All @@ -30,9 +30,9 @@ The map contains layers of data about objects in the city so that urbanists can
| Cultural heritage sites (security zone) | ⬇️ [okn‑security](https://github.com/ekaterinburgdev/map/blob/main/public/ekb-okn-security.json) | | [okn.midural.ru](https://okn.midural.ru/karta-obektov-kulturnogo-naslediya-sverdlovskoy-oblasti.html) || 🚧 |
| Houses data | _Not available for download now.<br />We use [these recommendations](https://github.com/kachkaev/tooling-for-how-old-is-this-house#tooling-for-how-old-is-thishouse)_ | | [openstreetmap.org](https://www.openstreetmap.org/)<br />[how-old-is-this.house](https://how-old-is-this.house/)<br />[mingkh.ru](https://mingkh.ru/)<br />[domaekb.ru](https://domaekb.ru) || 🚧 |

- ✅ — Verified source
- 🚧 — Under construction. Contains inaccuracies, be careful!
- 🔄 — [Autoupdate from sources](https://github.com/ekaterinburgdev/map-updater) (**now disabled**)
- ✅ — Verified source
- 🚧 — Under construction. Contains inaccuracies, be careful!
- 🔄 — [Autoupdate from sources](https://github.com/ekaterinburgdev/map-updater) (**now disabled**)

## Development

Expand Down
46 changes: 23 additions & 23 deletions components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,39 @@ import { CardLoader } from 'components/Card/components/Loader/Loader';
import { ContentConfig, MapItemType } from 'types/Content.types';

interface Props {
contentConfig: ContentConfig;
popupId?: string;
popupType: MapItemType | null;
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);
const [popupData, setPopupData] = useState<any>();
const [loading, setLoading] = useState<boolean>(false);

useEffect(() => {
async function fetchData() {
if (!popupId || !popupType) {
return;
}
useEffect(() => {
async function fetchData() {
if (!popupId || !popupType) {
return;
}

setLoading(true);
setLoading(true);

const requestFunction = contentConfig[popupType].oneItemRequest;
const requestFunction = contentConfig[popupType].oneItemRequest;

const data = await requestFunction(popupId);
const data = await requestFunction(popupId);

setPopupData(data);
setLoading(false);
}
setPopupData(data);
setLoading(false);
}

fetchData();
}, [contentConfig, popupId, popupType]);
fetchData();
}, [contentConfig, popupId, popupType]);

const CardContent = useMemo(() => {
setLoading(true);
const CardContent = useMemo(() => {
setLoading(true);

return contentConfig[popupType]?.cardContent || (() => null);
}, [contentConfig, popupType]);
return contentConfig[popupType]?.cardContent || (() => null);
}, [contentConfig, popupType]);

return loading ? <CardLoader /> : <CardContent placemark={popupData} />;
return loading ? <CardLoader /> : <CardContent placemark={popupData} />;
}
20 changes: 10 additions & 10 deletions components/Card/DesktopCard/DesktopCard.module.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
.DesktopCard {
position: relative;
background: #1e2841 !important;
border-radius: 10px !important;
max-height: calc(90vh - 2vw) !important;
overflow-y: auto;
overflow-x: hidden;
position: relative;
background: #1e2841 !important;
border-radius: 10px !important;
max-height: calc(90vh - 2vw) !important;
overflow-y: auto;
overflow-x: hidden;

@mixin scroll;
@mixin scroll;
}

.DesktopCard__header {
position: absolute;
right: 0;
top: 0;
position: absolute;
right: 0;
top: 0;
}
Loading

1 comment on commit 88aec05

@ekbdev
Copy link

@ekbdev ekbdev commented on 88aec05 Dec 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for map ready!

✅ Preview
https://map-plxhn9590-ekbdev.vercel.app
https://ekbdev-map-refactor.vercel.app

Built with commit 88aec05.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.