mirror of
https://github.com/yawaflua/SusMarket.git
synced 2025-12-11 16:16:26 +02:00
Migrate react app to typescript
Installed the necessary dependencies and config files
This commit is contained in:
@@ -5,6 +5,7 @@ import ProfilePage from "./components/pages/ProfilePage";
|
||||
import ScamPage from "./components/pages/ScamPage";
|
||||
import Header from "./components/blocks/Header";
|
||||
import SearchIcon from "../src/assets/icons/search-form__icon.svg";
|
||||
import React from "react";
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
@@ -1,4 +1,6 @@
|
||||
export default function Header() {
|
||||
import React from "react";
|
||||
|
||||
export default function Header(SearchIcon:any) {
|
||||
return(
|
||||
<header className="header">
|
||||
<h1 className="header__title">SuSMarket</h1>
|
||||
@@ -1,3 +1,5 @@
|
||||
import React from "react";
|
||||
|
||||
export default function LoginMenu() {
|
||||
return(
|
||||
<>
|
||||
@@ -1,3 +1,5 @@
|
||||
import React from "react";
|
||||
|
||||
export default function PopupMap() {
|
||||
return(
|
||||
<>
|
||||
@@ -1,3 +1,5 @@
|
||||
import React from "react";
|
||||
|
||||
export default function ProductCard() {
|
||||
return(
|
||||
<>
|
||||
@@ -1,3 +1,5 @@
|
||||
import React from "react";
|
||||
|
||||
export default function HomePage() {
|
||||
return(
|
||||
<section>
|
||||
@@ -1,3 +1,5 @@
|
||||
import React from "react";
|
||||
|
||||
export default function PaymentPage() {
|
||||
return(
|
||||
<>
|
||||
@@ -1,3 +1,5 @@
|
||||
import React from "react";
|
||||
|
||||
export default function ProductPage() {
|
||||
return(
|
||||
<>
|
||||
@@ -1,3 +1,5 @@
|
||||
import React from "react";
|
||||
|
||||
export default function ProfilePage() {
|
||||
return(
|
||||
<>
|
||||
@@ -1,3 +1,5 @@
|
||||
import React from "react";
|
||||
|
||||
export default function ScamPage() {
|
||||
return(
|
||||
<>
|
||||
4
reactapp/src/custom.d.ts
vendored
Normal file
4
reactapp/src/custom.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
declare module "*.svg" {
|
||||
const content: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
|
||||
export default content;
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import './index.scss';
|
||||
import './reset.css';
|
||||
import App from './App';
|
||||
|
||||
const root = ReactDOM.createRoot(document.getElementById('root'));
|
||||
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
Reference in New Issue
Block a user