- A = [xA, yA] is a point on the 2D plane. Same for B, C, ...
- lengths are in any unit (ex: pixels)
- code snippets are in JavaScript
angleRad = angleDeg * Math.PI / 180;
In addition to the Storybook for React setup, you'll also need to install these packages:
npm i -D @babel/core babel-loader css-loader style-loader
import { NextResponse } from 'next/server' | |
import type { NextRequest } from 'next/server' | |
export function middleware(req: NextRequest) { | |
// get cookie token | |
const hasToken = req.cookies.get('token') | |
// protected routes (admin routes) | |
if (req.nextUrl.pathname.startsWith('/admin')) { | |
if (hasToken) { |
// I want you to act as a Senior Frontend developer. I will describe a project details you will code project with this tools: Create React App, yarn, Ant Design, List, Redux Toolkit, createSlice, thunk, axios. You should merge files in single index.js file and nothing else. Do not write explanations. My first request is "Create Pokemon App that lists pokemons with images that come from PokeAPI sprites endpoint" | |
import React, { useEffect } from "react"; | |
import ReactDOM from "react-dom"; | |
import { Provider, useDispatch, useSelector } from "react-redux"; | |
import { createStore, applyMiddleware, combineReducers } from "redux"; | |
import thunk from "redux-thunk"; | |
import axios from "axios"; | |
import { createAsyncThunk, createSlice } from "@reduxjs/toolkit"; | |
import { List } from "antd"; |