4 Commits

Author SHA1 Message Date
6b6a9ae10c Обновить stubs/api/index.js 2025-10-13 18:04:10 +03:00
624c7d9766 Добавление функционала редактирования аватара
Добавил библиотеку для редактирования аватара пользователя
2025-10-10 10:28:48 +03:00
Primakov Alexandr Alexandrovich
a5f2047cda 2.0.0 2024-11-23 15:06:03 +03:00
Primakov Alexandr Alexandrovich
30e5281b4a ijl -> brojs 2024-11-23 15:04:50 +03:00
7 changed files with 2271 additions and 3128 deletions

View File

@@ -3,7 +3,6 @@ import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint"; import tseslint from "typescript-eslint";
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js"; import pluginReactConfig from "eslint-plugin-react/configs/recommended.js";
export default [ export default [
{languageOptions: { globals: globals.browser }}, {languageOptions: { globals: globals.browser }},
pluginJs.configs.recommended, pluginJs.configs.recommended,
@@ -20,5 +19,8 @@ export default [
"@typescript-eslint/no-explicit-any": "off" "@typescript-eslint/no-explicit-any": "off"
}, },
ignores: ["src/index.tsx"] ignores: ["src/index.tsx"]
},
{
ignores: ['stubs/**/*']
} }
]; ];

5349
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "r-and-m", "name": "r-and-m",
"version": "1.1.0", "version": "2.0.0",
"description": "Рик огурчик", "description": "Рик огурчик",
"main": "./src/index.tsx", "main": "./src/index.tsx",
"directories": { "directories": {
@@ -8,9 +8,9 @@
}, },
"scripts": { "scripts": {
"test": "jest", "test": "jest",
"start": "ijl-cli server --port=8099 --with-open-browser", "start": "brojs server --port=8099 --with-open-browser",
"build": "npm run clean && ijl-cli build --dev", "build": "npm run clean && brojs build --dev",
"build:prod": "npm run clean && ijl-cli build", "build:prod": "npm run clean && brojs build",
"eslint": "exit 0", "eslint": "exit 0",
"clean": "rimraf dist" "clean": "rimraf dist"
}, },
@@ -18,9 +18,9 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@brojs/cli": "^1.6.3",
"@emotion/react": "^11.11.4", "@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5", "@emotion/styled": "^11.11.5",
"@ijl/cli": "^5.1.0",
"@types/react": "^18.2.74", "@types/react": "^18.2.74",
"@types/react-dom": "^18.2.24", "@types/react-dom": "^18.2.24",
"express": "^4.19.2", "express": "^4.19.2",

View File

@@ -1,16 +1,16 @@
import { getNavigationsValue, getConfigValue } from '@ijl/cli'; import { getNavigationValue, getConfigValue } from '@brojs/cli';
import { generatePath } from 'react-router-dom'; import { generatePath } from 'react-router-dom';
const baseUrl = getNavigationsValue('r-and-m.main'); const baseUrl = getNavigationValue('r-and-m.main');
export const URLs = { export const URLs = {
baseUrl, baseUrl,
ui: { ui: {
search: getNavigationsValue('r-and-m.search') && `${baseUrl}${getNavigationsValue('r-and-m.search')}`, search: getNavigationValue('r-and-m.search') && `${baseUrl}${getNavigationValue('r-and-m.search')}`,
charDetail: { charDetail: {
url: `${baseUrl}${getNavigationsValue('r-and-m.character.detail')}`, url: `${baseUrl}${getNavigationValue('r-and-m.character.detail')}`,
on: Boolean(getNavigationsValue('r-and-m.character.detail')), on: Boolean(getNavigationValue('r-and-m.character.detail')),
getUrl: (charId: number) => generatePath(`${baseUrl}${getNavigationsValue('r-and-m.character.detail')}`, { charId }) getUrl: (charId: number) => generatePath(`${baseUrl}${getNavigationValue('r-and-m.character.detail')}`, { charId })
} }
}, },
api: { api: {

View File

@@ -55,7 +55,7 @@ export const SearchCharacterPage = () => {
search: searchValue search: searchValue
}), }),
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'shmapplication/json'
} }
}) })
.then((response) => response.json()) .then((response) => response.json())
@@ -104,15 +104,19 @@ export const SearchCharacterPage = () => {
label="Поиск" label="Поиск"
placeHolder="Напишите имя для поиска" placeHolder="Напишите имя для поиска"
/> />
{searchValueError && <span style={{ color: 'red', display: 'flex'}}>Ай яй</span>}
{searchValueError && (
<span style={{ color: 'red', display: 'flex'}}>Ай яй</span>
}
<SearchButton type="submit">Поиск</SearchButton> <SearchButton type="submit">Поиск</SearchButton>
</SearchForm> </SearchForm>
</MainCardWrapper> </MainCardWrapper>
<CharacterList> <CharacterList>
{data?.map((char) => ( {data?.map((char) => (
<Connectedlink to={URLs.ui.charDetail.getUrl(char.id)}> <Connectedlink to={URLs.ui.charDetail.getUrl(char.id)}>
<CharacterItem key={char.id}> <CharacterItem>
<img src={char.image} /> <img src={char.image} key={char.id} />
<CharName>{char.name}</CharName> <CharName>{char.name}</CharName>
</CharacterItem> </CharacterItem>
</Connectedlink> </Connectedlink>

View File

@@ -4,7 +4,7 @@ router.get("/landing-data", (request, response) => {
response.send(require("../json/landing-data/success.json")); response.send(require("../json/landing-data/success.json"));
}); });
router.post("/login", (req, res) => { router.smost("/login", (req, res) => {
const { username, password } = req.body; const { username, password } = req.body;
if (username === "admin") { if (username === "admin") {
response.send(require("../json/user/sitter.success.json")); response.send(require("../json/user/sitter.success.json"));