Skip to content

Commit 2134065

Browse files
author
Viktor
committed
OpenGraph tags added
1 parent 30ee25f commit 2134065

File tree

12 files changed

+37
-25
lines changed

12 files changed

+37
-25
lines changed

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,8 @@ module.exports = {
4646
'error',
4747
{ 'ignoreRestSiblings': true }
4848
]
49+
},
50+
'globals': {
51+
'process': true
4952
}
5053
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@
6161
$ npm run build
6262
```
6363
\
64-
Если необходимо сделать билд с префиксом в url, установите его в переменной PUBLIC_URL и REACT_APP_PREFIX с косой чертой в начале, но без неё в конце.
64+
Если необходимо сделать билд с префиксом в url, установите его в переменной PUBLIC_URL с косой чертой в начале, но без неё в конце.
6565
```
66-
$ REACT_APP_PREFIX=/SIPacker npm run build
66+
$ PUBLIC_URL=/SIPacker npm run build
6767
```
6868

6969
## Запуск с фейковым доменом

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"sw-start": "http-server build",
6868
"build": "react-app-rewired build",
6969
"netlify-build": "react-app-rewired build && echo \"/* /index.html 200\" > build/_redirects",
70-
"ghp-build": "PUBLIC_URL=/SIPacker REACT_APP_PREFIX=/SIPacker react-app-rewired build",
70+
"ghp-build": "PUBLIC_URL=/SIPacker react-app-rewired build",
7171
"test": "react-app-rewired test",
7272
"eject": "react-scripts eject"
7373
},

public/index.html

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
<!DOCTYPE html>
22
<html lang="ru">
3-
<head>
4-
<meta charset="utf-8" />
5-
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1" />
7-
<meta name="theme-color" content="#03053e" />
8-
<meta name="description" content="Простой и мощный онлайн-редактор паков к SIGame для всех платформ и любых вопросов" />
9-
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
10-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
11-
<title>SIPacker</title>
12-
</head>
133
<body>
144
<noscript>You need to enable JavaScript to run this app.</noscript>
155
<div id="root"></div>

src/App.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import 'dayjs/locale/ru'
1515
import { history } from './utils'
1616
import NotFound404 from 'components/NotFound404'
1717
import ContextMenuProvider from 'components/ContextMenu'
18+
import { Helmet } from 'react-helmet'
1819

1920
export const darkTheme = createTheme({
2021
palette: {
@@ -25,11 +26,29 @@ export const darkTheme = createTheme({
2526
},
2627
})
2728

29+
function Head() {
30+
return (
31+
<Helmet>
32+
<meta charSet='utf-8' />
33+
<link rel='icon' href={`${process.env.PUBLIC_URL}/favicon.ico`} />
34+
<meta name='viewport' content='width=device-width, initial-scale=1' />
35+
<meta name='theme-color' content='#03053e' />
36+
<meta name='description' content='Простой и мощный онлайн-редактор паков к SIGame для всех платформ, работающий без сети и поддерживающий все типы вопросов, события сценария и паков' />
37+
<link rel='apple-touch-icon' href={`${process.env.PUBLIC_URL}/logo192.png`} />
38+
<link rel='manifest' href={`${process.env.PUBLIC_URL}/manifest.json`} />
39+
<meta property='og:type' content='website' />
40+
<meta property='og:image' content={`${process.env.PUBLIC_URL}/logo512.png`} />
41+
<title>SIPacker</title>
42+
</Helmet>
43+
)
44+
}
45+
2846
export default function App() {
2947
return (
3048
<Provider store={sipackerStore}>
49+
<Head />
3150
<ThemeProvider theme={darkTheme}>
32-
<BrowserRouter history={history} basename={process.env.REACT_APP_PREFIX}>
51+
<BrowserRouter history={history} basename={process.env.PUBLIC_URL}>
3352
<ContextMenuProvider>
3453
<Container>
3554
<Navigation />

src/components/ConfirmationDialog/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const ConfirmationDialog = React.forwardRef((props, ref) => {
3636

3737
return (
3838
<MuiDialog
39-
maxWidth="xs"
39+
maxWidth='xs'
4040
open={open}
4141
onClose={() => handleAction(false)}
4242
>
@@ -55,10 +55,10 @@ const ConfirmationDialog = React.forwardRef((props, ref) => {
5555
</DialogContentText>
5656
</DialogContent>
5757
<DialogActions>
58-
<Button autoFocus onClick={() => handleAction(false)} color="primary">
58+
<Button autoFocus onClick={() => handleAction(false)} color='primary'>
5959
Отмена
6060
</Button>
61-
<Button onClick={() => handleAction(true)} color="primary">
61+
<Button onClick={() => handleAction(true)} color='primary'>
6262
{confirmText ?? 'Продолжить'}
6363
</Button>
6464
</DialogActions>

src/components/ContextMenu/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function ContextMenu(props) {
4141
ReactDOM.createPortal(
4242
<Menu
4343
open={props.menu?.position}
44-
anchorReference="anchorPosition"
44+
anchorReference='anchorPosition'
4545
anchorPosition={props.menu?.position && { top: props.menu.position[1], left: props.menu.position[0] }}
4646
onClose={close}
4747
>

src/components/ItemsList/AddItem/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function ItemName(props) {
6767

6868
return (
6969
<FormControl variant='outlined' className={props.className}>
70-
<InputLabel size="small">{props.label}</InputLabel>
70+
<InputLabel size='small'>{props.label}</InputLabel>
7171
<OutlinedInput
7272
label={props.label}
7373
size='small'

src/components/Navigation/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default function Navigation() {
6565
службы <a
6666
href='https://vk.com/id245297843'
6767
target='_blank'
68-
rel="noreferrer"
68+
rel='noreferrer'
6969
className='onHover'
7070
>Роме Кучину</a>, который своим комментарием натолкнул меня на идею создания этого сайта, но не может
7171
работать со мной по причине Я в армии.

src/components/RenameDialog/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ const RenameDialog = React.forwardRef((props, ref) => {
5151
/>
5252
</DialogContent>
5353
<DialogActions>
54-
<Button autoFocus onClick={handleCancel} color="primary">
54+
<Button autoFocus onClick={handleCancel} color='primary'>
5555
Отмена
5656
</Button>
57-
<Button onClick={handleRename} color="primary" disabled={!value.length}>
57+
<Button onClick={handleRename} color='primary' disabled={!value.length}>
5858
Переименовать
5959
</Button>
6060
</DialogActions>

0 commit comments

Comments
 (0)