Skip to content

Commit

Permalink
feat: setToken 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
kanghaeun committed Jul 23, 2024
1 parent 80251ab commit 1c9dbda
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion FE/error/src/components/EconoCalendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ const EconoCalendar = ({ isLoggedIn, setIsLoggedIn }) => {
const [createModalIsOpen, setCreateModalIsOpen] = useState(false);
const [selectedDate, setSelectedDate] = useState("");
const [token, setToken] = useState(null);

useEffect(() => {
const storedToken = localStorage.getItem("slackToken");
setToken(storedToken);

const isUserLoggedIn = !!storedToken;
setIsLoggedIn(isUserLoggedIn);

const uri = isUserLoggedIn
? "/api/calendar/all"
: "/api/calendar/public/all";
: "/api/calendar/all/public";
const config = isUserLoggedIn
? { headers: { Authorization: `Bearer ${storedToken}` } }
: {};
Expand Down Expand Up @@ -290,6 +292,7 @@ const CalendarContainer = styled.div`
background-color: #fff;
border-color: #cbcbcb;
color: #595959;
margin-right: 1rem;
}
.fc-event-title-container {
height: 1.3rem;
Expand All @@ -298,4 +301,7 @@ const CalendarContainer = styled.div`
font-size: 0.95rem;
margin-left: 0.3rem;
}
.fc-direction-ltr .fc-toolbar > * > :not(:first-child) {
margin-left: 0.5rem;
}
`;

0 comments on commit 1c9dbda

Please sign in to comment.