Skip to content

Commit

Permalink
Merge pull request #10 from team-xquare/mainPage
Browse files Browse the repository at this point in the history
main page
  • Loading branch information
dutexion authored Feb 25, 2024
2 parents 7c939a8 + 882fcf9 commit a86c17e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
"editor.formatOnSave": true,
"[typescriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
}
}
5 changes: 5 additions & 0 deletions packages/user/src/apis/Main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { instance } from './axios';

export const getProjects = async () => {
return await instance.get('/project/list');
};
Empty file.
16 changes: 8 additions & 8 deletions packages/user/src/pages/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import { LatestProject } from '../components/Main/LatestProject';
import { theme } from '@merge/design-system';
import styled from '@emotion/styled';
import BannerImg from '../assets/banner.png';
import TopPageButtonImg from '../assets/topPageButton.svg';
import ScrollImg from "../assets/topPageButton.svg";
import { useRef } from 'react';

export const Main = () => {
const banner = useRef<HTMLImageElement>(null);
const container = useRef<HTMLImageElement>(null);
const scrollToTop = () => {
if (banner.current) {
banner.current.scrollIntoView({ behavior: 'smooth' });
if (container.current) {
container.current.scroll({ top: 0, behavior: 'smooth' });
}
};
return (
<Container>
<Banner src={BannerImg} ref={banner} />
<Container ref={container}>
<Banner src={BannerImg} />
<Title marginTop="">즐겨찾는 프로젝트</Title>
<FavoriteProjectContainer>
<FavoriteProjects />
Expand Down Expand Up @@ -63,18 +63,18 @@ const LatestProjectContainer = styled.div`
`;

const TopPageButton = styled.div`
background-image: url(${ScrollImg});
position: fixed;
width: 50px;
height: 50px;
border-radius: 50%;
top: 85%;
left: 81%;
border: 1px solid ${theme.color.primary100};
background-image: url(${TopPageButtonImg});
background-repeat: no-repeat;
background-position: center center;
&:hover {
cursor: pointer;
}
`;
`;

0 comments on commit a86c17e

Please sign in to comment.