Skip to content

Commit

Permalink
Create basic components for header and page header
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkshin committed Jan 15, 2025
1 parent d99fbad commit 76fd617
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/App.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.app {
display: flex;
justify-content: center;
align-items: center;
gap: 1rem;
}

Expand All @@ -10,3 +9,9 @@
border-radius: 10px;
box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.25);
}

.sidebar {
display: flex;
flex-direction: column;
gap: 1rem;
}
9 changes: 7 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { useState } from 'react';
import { Calendar, EventDetails } from 'components';
import { Header, Calendar, EventDetails, PageHeader } from 'components';
import { Event } from 'types/Event';
import 'App.css';

const App = () => {
const [selectedEvent, setSelectedEvent] = useState<Event | null>(null);

// TODO: How will this be structured?
// Test events => feel free to change the values for testing
// date and time field NOT FINAL => need to account for timezones (unless it's worked out in the backend)
const testEvents = [
{
Expand Down Expand Up @@ -83,7 +84,11 @@ const App = () => {

return (
<div className="app">
{selectedEvent && <EventDetails selectedEvent={selectedEvent} />}
<div className="sidebar">
<Header />
<PageHeader />
{selectedEvent && <EventDetails selectedEvent={selectedEvent} />}
</div>
<Calendar setSelectedEvent={setSelectedEvent} events={testEvents} />
</div>
);
Expand Down
1 change: 0 additions & 1 deletion src/components/Calendar/Calendar.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ h3 {
display: grid;
grid-template-columns: repeat(7, 1fr);
width: fit-content;
border: 1px solid #bababa;
}

.calendar-cell {
Expand Down
2 changes: 1 addition & 1 deletion src/components/EventDetails/EventDetails.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.event-details {
display: block;
width: 30rem;
width: 20rem;
padding: 1rem;
}
4 changes: 4 additions & 0 deletions src/components/Header/Header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
header h1 {
margin: 0.25rem;
font-size: 2.5rem;
}
11 changes: 11 additions & 0 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import './Header.css';

const Header = () => {
return (
<header>
<h1>Header</h1>
</header>
);
};

export default Header;
5 changes: 5 additions & 0 deletions src/components/PageHeader/PageHeader.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.page-header {
display: block;
width: 20rem;
padding: 1rem;
}
11 changes: 11 additions & 0 deletions src/components/PageHeader/PageHeader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import './PageHeader.css';

const PageHeader = () => {
return (
<div className="page-header card">
<h2>Page Header</h2>
</div>
);
};

export default PageHeader;
2 changes: 2 additions & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export { default as Calendar } from 'components/Calendar/Calendar';
export { default as CalendarEvent } from 'components/CalendarEvent/CalendarEvent';
export { default as EventDetails } from 'components/EventDetails/EventDetails';
export { default as PageHeader } from 'components/PageHeader/PageHeader';
export { default as Header } from 'components/Header/Header';

0 comments on commit 76fd617

Please sign in to comment.