Skip to content

Commit

Permalink
enhancement_307_fix_routing_at_header_icon
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderMorugin committed Apr 18, 2024
1 parent 49b4ee4 commit cedc590
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 19 deletions.
6 changes: 2 additions & 4 deletions src/shared/ui/logo/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,20 @@ import styles from './logo.module.scss'

type TLogoProps = {
image: string
title: string
width: string
height: string
}
/**
* @param {string} image - путь к логотипу на сервере
* @param {string} title - лейбл логотипа (и альт)
* @param {string} width - ширина логотипа
* @param {string} height - высота логотипа
*/

const Logo: FC<TLogoProps> = ({ image, title, width, height }) => {
const Logo: FC<TLogoProps> = ({ image, width, height }) => {
return (
<div className={styles.container}>
<Link to={Routes.HOME} className={styles.link}>
<img src={image} title={title} alt={title} style={{ width, height }} />
<img src={image} alt="Logo" style={{ width, height }} />
</Link>
</div>
)
Expand Down
7 changes: 1 addition & 6 deletions src/widgets/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,7 @@ function Footer() {
<div className={styles.footer__container}>
<div className={styles.footer__middle}>
<div className={styles['footer__col-one']}>
<Logo
image={coreBaseData.footer.main_logo.image}
title={coreBaseData.footer.main_logo.title}
width="114px"
height="38px"
/>
<Logo image={coreBaseData.footer.main_logo.image} width="114px" height="38px" />
<Paragraph className={styles.footer__caption}>{coreBaseData.footer.company_info}</Paragraph>
</div>
<div className={styles['footer__col-two']}>
Expand Down
7 changes: 1 addition & 6 deletions src/widgets/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,7 @@ function Header() {
</div>

<div className={styles['header__row-two']}>
<Logo
image={coreBaseData.header.main_logo.image}
title={coreBaseData.header.main_logo.title}
width="138px"
height="46px"
/>
<Logo image={coreBaseData.header.main_logo.image} width="138px" height="46px" />
<SearchProduct />
<HeaderAccount {...headerAccountData} />
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/widgets/Header/model/slice/headerSlice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ const initialState: CoreBaseHeaderSchema = {
isLoading: false,
header: {
main_logo: {
image: '',
title: ''
image: ''
},
support: {
callback: '',
Expand Down
1 change: 0 additions & 1 deletion src/widgets/Header/model/types/types.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
interface Logo {
image: string
title: string
}

interface Support {
Expand Down

0 comments on commit cedc590

Please sign in to comment.