Skip to content

Commit

Permalink
feat : svg 파일 input
Browse files Browse the repository at this point in the history
  • Loading branch information
BellYun committed May 31, 2023
1 parent 9abb729 commit 0b9b84b
Show file tree
Hide file tree
Showing 9 changed files with 2,825 additions and 153 deletions.
2,768 changes: 2,620 additions & 148 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@
"react-hook-form": "^7.43.9",
"react-router-dom": "^6.10.0",
"recoil": "^0.7.7",
"sass": "^1.61.0",
"styled-components": "^5.3.10",
"tailwindcss": "^3.3.2"
"styled-components": "^5.3.10",
"sass": "^1.61.0",
"vite-plugin-svgr": "^3.2.0",
"vite-svg-loader": "^4.0.0"
},
"devDependencies": {
"@svgr/webpack": "^8.0.1",
"@types/node": "^18.15.11",
"@types/react": "^18.0.28",
"@types/react-datepicker": "^4.11.2",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/image/map.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.svg .seoul {
height: 1px;
}
172 changes: 172 additions & 0 deletions src/assets/image/southKoreaLow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion src/components/main/mappage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,15 @@
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-end;
justify-content: flex-start;
}

.mapdetail {
width: 530px;
height: 90%;
flex-direction: column;
.line {
transform: scale(0.54);
justify-self: center;
}
}
3 changes: 2 additions & 1 deletion src/components/main/mappage.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react';
import './mappage.scss';
import { ReactComponent as Map } from '@/assets/image/southKoreaLow.svg';

const Mappage = () => {
return (
<div className="mapPageBackground">
<div>여행가고 싶은곳을 눌러보세요</div>
<div>mappage</div>
<Map className="mapdetail" />
</div>
);
};
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"paths": {
"@/*": ["src/*"]
},
"types": ["vite-plugin-svgr/client"],
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
Expand All @@ -21,5 +22,6 @@
"jsx": "react-jsx"
},
"include": ["src", "postcss.config.js"],
"include": ["src", "types.d.ts"],
"references": [{ "path": "./tsconfig.node.json" }]
}
8 changes: 8 additions & 0 deletions types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
declare module '*.svg' {
import * as React from 'react';

export const ReactComponent: React.FunctionComponent<
React.ComponentProps<'svg'> & { title?: string }
>;
export default ReactComponent;
}
3 changes: 2 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tsconfigPaths from 'vite-tsconfig-paths';
import path from 'path';
import svgr from 'vite-plugin-svgr';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), tsconfigPaths()],
plugins: [react(), tsconfigPaths(), svgr()],
server: {
port: 3000,
},
Expand Down

0 comments on commit 0b9b84b

Please sign in to comment.