Skip to content

Commit

Permalink
chore: change architecture, fix react-helmet
Browse files Browse the repository at this point in the history
  • Loading branch information
Victoria Kapitonenko committed Nov 2, 2023
1 parent 6b6ecb9 commit 2f03919
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 17 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ yarn start
```

## Features
- Starting FSD architecture
- Typescript
- Eslint & Prettier
- Support of runtime environment variables with dynamic values
- normalize.css and shared reset css file
- React Helmet, axios, classnames libraries
- Normalize.css and shared reset css file
- All necessary meta tags for SEO in public/index.html
- Axios instance
- React Helmet & classnames
1 change: 1 addition & 0 deletions template.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"@types/node": "^20.8.7",
"@types/react": "^18.2.31",
"@types/react-dom": "^18.2.14",
"@types/react-helmet": "^6.1.8",
"axios": "^1.5.1",
"classnames": "^2.3.2",
"cra-envs": "^1.2.8",
Expand Down
8 changes: 3 additions & 5 deletions template/src/App.tsx → template/src/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { BrowserRouter, Routes, Route } from "react-router-dom";
import StartPage from "./pages";
import StartPage from "../pages";

function App() {
export const App = () => {
return (
<BrowserRouter>
<Routes>
<Route path="/" element={<StartPage />} />
</Routes>
</BrowserRouter>
);
}

export default App;
};
3 changes: 3 additions & 0 deletions template/src/app/styles/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
html {
font-family: Arial, sans-serif;
}
5 changes: 1 addition & 4 deletions template/src/core/head/CoreHead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ export const CoreHead = () => {
return (
<Helmet>
<title>CRA template</title>
<meta
property="og:title"
content="CRA template"
/>
<meta property="og:title" content="CRA template" />
<meta name="description" content="" />
<meta property="og:description" content="" />
</Helmet>
Expand Down
5 changes: 3 additions & 2 deletions template/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import "normalize.css";

import "./assets/css/reset.css";
import "./shared/assets/css/reset.css";
import "./app/styles/global.css";

import ReactDOM from "react-dom/client";
import App from "./App";
import { App } from "./app/App";
import reportWebVitals from "./reportWebVitals";

const root = ReactDOM.createRoot(
Expand Down
6 changes: 6 additions & 0 deletions template/src/shared/api/axiosInstance.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import axios from "axios";
import { env } from "../../core/env";

export const axiosInstance = axios.create({
baseURL: env.API_URL ?? "",
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
box-sizing: border-box;
}

html {
font-family: Manrope, sans-serif;
}

h1,
h2,
h3,
Expand Down
1 change: 1 addition & 0 deletions template/src/shared/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { axiosInstance } from "./api/axiosInstance";

0 comments on commit 2f03919

Please sign in to comment.