edit header

This commit is contained in:
admin 2024-12-15 21:09:15 +03:00
parent 5aa97a5255
commit d7c438715e
10 changed files with 634 additions and 538 deletions

1071
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,28 +0,0 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { getNavigationsValue } from '@brojs/cli';
const navigations: Array<{ name: string; href: string }> = [
{
name: 'Регистрация',
href: getNavigationsValue('sberhubproject.signup')
}
];
const Header = (): React.ReactElement => {
return (
<header>
<ul>
{navigations.map((item) => {
return (
<li key={item.name}>
<Link to={item.href}>{item.name}</Link>
</li>
);
})}
</ul>
</header>
);
};
export default Header;

View File

@ -0,0 +1,7 @@
import styled from '@emotion/styled';
import AppBar from '@mui/material/AppBar';
export const AppBarStyled = styled(AppBar)`
background-color: var(--tg-theme-button-color);
`;

View File

@ -0,0 +1,18 @@
import React from 'react';
import Logo from './logo';
import { AppBarStyled } from './index.style';
import Toolbar from '@mui/material/Toolbar';
const Header = (): React.ReactElement => {
return (
<header>
<AppBarStyled position="static">
<Toolbar>
<Logo />
</Toolbar>
</AppBarStyled>
</header>
);
};
export default Header;

View File

@ -0,0 +1,14 @@
import React from 'react';
import styled from '@emotion/styled';
import logoPng from './logo.png';
const LogoStyled = styled.img`
height: 40px;
padding: 8px;
`;
const Logo = () => {
return <LogoStyled src={logoPng} alt={'logo'} />;
};
export default Logo;

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -17,19 +17,8 @@ import { useConstant } from '../Constant';
import { GridChildrenStyle } from './index.style'; import { GridChildrenStyle } from './index.style';
const SingUpPage = (): React.ReactElement => { const SingUpPage = (): React.ReactElement => {
const [selectedPhoto, setSelectedPhoto] = useState(null);
const [selectedOption, setSelectedOption] = useState<string | null>(null);
const handlePhotoChange = (photo) => {
setSelectedPhoto(photo);
};
const handleChange = (selectedOption) => {
setSelectedOption(selectedOption);
};
const { interests } = useConstant(); const { interests } = useConstant();
//const { user_id, username, onClose } = useTelegram(); //const { user_id, username, onClose } = useTelegram();
/* /*
const handleSubmit = async (event) => { const handleSubmit = async (event) => {
@ -55,7 +44,7 @@ const SingUpPage = (): React.ReactElement => {
<Container component="main" maxWidth="xs"> <Container component="main" maxWidth="xs">
<Box <Box
sx={{ sx={{
marginTop: 8, marginTop: 4,
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
alignItems: 'center', alignItems: 'center',
@ -91,8 +80,8 @@ const SingUpPage = (): React.ReactElement => {
</GridChildrenStyle> </GridChildrenStyle>
<GridChildrenStyle size={12}> <GridChildrenStyle size={12}>
<Photo <Photo
id="photo"
onPhotoChange={handlePhotoChange} name="photo"
/> />
</GridChildrenStyle> </GridChildrenStyle>
<GridChildrenStyle size={12}> <GridChildrenStyle size={12}>

View File

@ -33,7 +33,7 @@ export const InterestsStyled = styled(Select)`
} }
&.select__option--is-selected { &.select__option--is-selected {
background-color: var(--tg-theme-selected-color, #0066ff); background-color: var(--tg-theme-button-color);
color: #ffffff; color: #ffffff;
} }
@ -48,7 +48,7 @@ export const InterestsStyled = styled(Select)`
} }
.select__multi-value { .select__multi-value {
background-color: var(--tg-theme-selected-color, #0066ff); background-color: var(--tg-theme-button-color);
color: #ffffff; color: #ffffff;
border-radius: 4px; border-radius: 4px;

View File

@ -1,7 +1,7 @@
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import Avatar from "@mui/material/Avatar"; import Avatar from "@mui/material/Avatar";
export const PhotoStyled = styled.div<{ value: string | null }>` export const PhotoStyled = styled.div<{ id: string, name: string, value: string | null }>`
position: relative; position: relative;
display: inline-block; display: inline-block;
cursor: pointer; cursor: pointer;

View File

@ -2,7 +2,7 @@ import * as React from 'react';
import { useState } from 'react'; import { useState } from 'react';
import { AvatarStyled, PhotoStyled, InputStyled } from './index.style'; import { AvatarStyled, PhotoStyled, InputStyled } from './index.style';
const Photo = ({ defaultPhoto = null, onPhotoChange }): React.ReactElement => { const Photo = ({ id, name, defaultPhoto = null}): React.ReactElement => {
const [photo, setPhoto] = useState(defaultPhoto); const [photo, setPhoto] = useState(defaultPhoto);
const handleFileChange = (event) => { const handleFileChange = (event) => {
@ -13,7 +13,6 @@ const Photo = ({ defaultPhoto = null, onPhotoChange }): React.ReactElement => {
reader.onload = (e) => { reader.onload = (e) => {
const newPhoto = e.target.result; const newPhoto = e.target.result;
setPhoto(newPhoto); setPhoto(newPhoto);
if (onPhotoChange) onPhotoChange(newPhoto);
}; };
reader.readAsDataURL(file); reader.readAsDataURL(file);
@ -27,7 +26,11 @@ const Photo = ({ defaultPhoto = null, onPhotoChange }): React.ReactElement => {
return ( return (
<PhotoStyled> <PhotoStyled
id = {id}
name = {name}
value = {photo}
>
<AvatarStyled <AvatarStyled
src={photo} src={photo}
alt="Выберите фотографию" alt="Выберите фотографию"