-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rank CSS 설정 & 로그인 API 연동 #20
- Loading branch information
Showing
5 changed files
with
117 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,29 @@ | ||
import axios from "axios"; | ||
|
||
// export const getToken = () => localStorage.getItem('access_token') ?? null | ||
// export const getToken = () => windows.localStorage.getItem("jwt"); | ||
|
||
export const statDustAPI = axios.create({ | ||
baseURL: '', | ||
headers: { | ||
accept: "application/json", | ||
"Content-Type": "application/json", | ||
"Access-Control-Allow-Origin": "*", | ||
// "ACCESS-TOKEN": getToken() ?? '' | ||
}, | ||
baseURL: "https://star-dust.shop", | ||
headers: { | ||
accept: "application/json", | ||
"Content-Type": "application/json", | ||
"Access-Control-Allow-Origin": "*", | ||
"X-ACCESS-TOKEN": "", | ||
}, | ||
}); | ||
|
||
export async function getDusts(university) { | ||
return await statDustAPI.get(`/map/${university}`) | ||
return await statDustAPI.get(`/map/${university}`); | ||
} | ||
|
||
export async function sendDustLocation(latitude, longitude) { | ||
return await statDustAPI.post('/dust/location', { latitude, longitude }) | ||
} | ||
return await statDustAPI.post("/dust/location", { latitude, longitude }); | ||
} | ||
|
||
export async function postuserLogin(nickname, phoneNum, univCode) { | ||
return await statDustAPI.post("/users/login", { | ||
nickname: nickname, | ||
phoneNum: phoneNum, | ||
univCode: univCode, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { useState, useRef, useEffect } from "react"; | ||
import { Map, CustomOverlayMap, MapMarker } from "react-kakao-maps-sdk"; | ||
import Image from "next/image"; | ||
import styles from "../../../styles/Rank.module.css"; | ||
|
||
const ranks = [ | ||
{ | ||
rankId: 1, | ||
nickname: "듀크", | ||
phonenumber: 7486, | ||
time: "00:00:30", | ||
}, | ||
{ | ||
rankId: 2, | ||
nickname: "쏘는사라있따야호", | ||
phonenumber: 7486, | ||
time: "00:00:40", | ||
}, | ||
{ | ||
rankId: 3, | ||
nickname: "미누스", | ||
phonenumber: 7486, | ||
time: "00:00:50", | ||
}, | ||
{ | ||
rankId: 4, | ||
nickname: "벨라", | ||
phonenumber: 7486, | ||
time: "00:01:00", | ||
}, | ||
{ | ||
rankId: 5, | ||
nickname: "타미", | ||
phonenumber: 7486, | ||
time: "00:01:30", | ||
}, | ||
]; | ||
|
||
export const RankList = () => { | ||
return ( | ||
<div> | ||
{ranks.map((rank) => { | ||
return ( | ||
<div className={styles.ranking}> | ||
{true == rank.rankId <= 3 ? ( | ||
<div className={styles.li_1_1}>{rank.rankId}</div> | ||
) : ( | ||
<div className={styles.li_1_2}>{rank.rankId}</div> | ||
)} | ||
<div className={styles.li_2}> | ||
{rank.nickname} | ||
{rank.phonenumber} | ||
</div> | ||
<div className={styles.li_3}>{rank.time}</div> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
); | ||
}; | ||
|
||
export default RankList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters