This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// stote.tsx | |
import { combineReducers, configureStore } from '@reduxjs/toolkit'; | |
import { | |
FLUSH, | |
PAUSE, | |
PERSIST, | |
PURGE, | |
REGISTER, | |
REHYDRATE, | |
persistReducer, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface Photo { | |
id: string; | |
photo: string; | |
alt: string; | |
} | |
const DATA: Photo[] = [ | |
{ | |
id: '1', | |
photo: '/images/Rectangle_15_329_351.webp', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Структура директорій (модульна) | |
/src | |
/store | |
store.ts | |
/services | |
usersApi.ts | |
postsApi.ts | |
commentsApi.ts | |
messagesApi.ts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createApi, fakeBaseQuery } from '@reduxjs/toolkit/query/react'; | |
import { db } from '../firebase/firebase.config'; | |
import { | |
collection, | |
query, | |
where, | |
collectionGroup, | |
updateDoc, | |
deleteDoc, | |
getDocs, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState } from 'react'; | |
import { Icon } from '../Icon'; | |
import { DivStyled, IconWrp, GasketStyled } from './RatingBar.styled'; | |
export const RatingBar = () => { | |
const [rate, setRate] = useState(0); | |
return ( | |
<> | |
<label> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
========================> 1 file: | |
import { useState } from "react"; | |
import PropTypes from "prop-types"; | |
import { Button } from "./Button.styled"; | |
export default function ButtonStyled({ text }) { | |
const [animationClass, setAnimationClass] = useState(""); | |
const handleClick = ({nativeEvent}) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
У input (всі типи) і textArea деякі браузери роблять заокруглення кутів, | |
щоб це заблокувати - потрібно додати властивості до стилів: | |
border-radius: 0; | |
appearance: none; | |
-webkit-appearance: none; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. До секції додати id='назва' | |
2. У панелі навігації використати | |
<a href='#назва' aria-label='перехід на секцію'> | |
секція | |
</a> | |
3. Не можна для цього випадку використовувати 'react-router-dom' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Додати файли у проект, у папку /assets/icons | |
2. У файлі index.css додати загальний курсор | |
body { | |
cursor: url('./assets/icons/cursor.png'), auto; | |
} | |
3. У місце де потрібно ховер курсор | |
import cursorIcon from '../../assets/icons/click-cursor.png'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const UlStyled = styled.ul` | |
display: grid; | |
grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)); | |
grid-template-rows: repeat(2, minmax(200px, 1fr)); | |
grid-auto-flow: column; | |
grid-gap: 16px; | |
overflow-x: auto; | |
grid-row-gap: 40px; | |
grid-column-gap: 60px; |
NewerOlder