GithubHelp home page GithubHelp logo

shri-react-hw-2023's Introduction

This is a Next.js project bootstrapped with create-next-app.

Getting Started

  1. В качестве data-fetching используется rtk query
  2. В качестве хранилища - RTK
  3. Местами могут не сходиться отступы, прошу понять и простить, тех.нюансы с окружением.
  4. Архитектура - её практически нет, т.к проект относительно небольшой.

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Inter, a custom Google Font.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

shri-react-hw-2023's People

Contributors

zeraigr avatar

Watchers

 avatar

shri-react-hw-2023's Issues

Ревью домашней работы по React

Привет! Делаю ревью твоей работы. Работа отличная, все пункты выполнены.
Ставлю 11 баллов.

Комментарии по проекту, которые не повлияли на оценку.

  1. Билд не собирается, падает сборка скрин.
    Скорее всего проблема в этом экспорте
    export const AppContext = createContext<AppContextInterface>({});
    .
  2. Есть баги в адаптиве скрин.
  3. На странице фильма забыл добавить цвет фона для блоков скрин
  4. В сторе остались тестовые данные
    const initialState: CartState = {
    "2aT976Fs_Bek0e2ZR_05V": 10,
    "9t2dPgRBgWpmOXRXK5l4Q": 14,
    };
  5. Подобную логику я бы выносил в хуки. Если хук спецефичен для компонента, то обычно держу их рядом с компонентом.
    const { title, placeholder, className, variants } = props;
    const { isOpen, toggleOpen, closeDropDown } = useDropDown(styles.wrapper);
    const { genrePlaceholder, setGenrePlaceholder} = useContext(AppContext);
    const [curValue, setCurValue] = useState<string>(genrePlaceholder ||placeholder);
    const setCurrentName = useCallback((value: Genre | Cinema) => {
    if (typeof value !== 'object') {
    if (value === Genre.DEFAULT) {
    setCurValue(title);
    setGenrePlaceholder?.(title);
    } else {
    setCurValue(translateGenre(value));
    setGenrePlaceholder?.(translateGenre(value));
    }
    }
    }, [title, setGenrePlaceholder]);

    const dispatch = useAppDispatch();
    const { setCinemaId } = useContext(AppContext);
    const x = coords?.x,
    y = coords?.y;
    const setValueHandler = useCallback((value: Genre | Cinema) => {
    if (isCinema(value)) {
    !!setCinemaId && setCinemaId(value.id);
    } else {
    dispatch(setGenre(value));
    }
    close();
    setCurrentName(value);
    // fixing error when filter at the bottom of the page
    window.scrollTo({top: 0});
    }, [dispatch, close, setCurrentName, setCinemaId]);
    if (!x || !y) {
    return null;
    }
    let position = {
    top: y + HEADER_HEIGHT + DEFAULT_PADDING_VERTICAL + window.scrollY,
    left: x + DEFAULT_PADDING_HORIZONTAL
    };
    const mods = [
    {[styles.open]: isOpen},
    ];
  6. Констаты ссылочного типа я бы мемоизировал, что бы они не дергались на каждый ререндер компонента
    let position = {
    top: y + HEADER_HEIGHT + DEFAULT_PADDING_VERTICAL + window.scrollY,
    left: x + DEFAULT_PADDING_HORIZONTAL
    };
    const mods = [
    {[styles.open]: isOpen},
    ];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.