-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from josch87/feature/gunther32-upcoming-events
Feature/gunther32 upcoming events
- Loading branch information
Showing
27 changed files
with
452 additions
and
49 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
21 changes: 21 additions & 0 deletions
21
components/DashboardWidgets/UpcomingWidget/UpcomingWidget.js
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,21 @@ | ||
import InteractionListItem from "@/components/InteractionListItem/InteractionListItem"; | ||
import Scopebox from "@/components/Scopebox/Scopebox"; | ||
import { StyledUnorderedList } from "./UpcomingWidget.styled"; | ||
|
||
export default function UpcomingWidget({ interactions, contacts }) { | ||
return ( | ||
<Scopebox heading="Upcoming"> | ||
<StyledUnorderedList> | ||
{interactions.map((interaction) => { | ||
return ( | ||
<InteractionListItem | ||
key={interaction.id} | ||
interaction={interaction} | ||
contacts={contacts} | ||
/> | ||
); | ||
})} | ||
</StyledUnorderedList> | ||
</Scopebox> | ||
); | ||
} |
7 changes: 7 additions & 0 deletions
7
components/DashboardWidgets/UpcomingWidget/UpcomingWidget.styled.js
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,7 @@ | ||
import styled from "styled-components"; | ||
|
||
export const StyledUnorderedList = styled.ul` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 5px; | ||
`; |
36 changes: 36 additions & 0 deletions
36
components/DashboardWidgets/UpcomingWidget/UpcomingWidget.test.js
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,36 @@ | ||
import { | ||
contactsTestData, | ||
interactionsTestData, | ||
threeFutureInteractionsTestData, | ||
} from "@/data/TestData"; | ||
import UpcomingWidget from "./UpcomingWidget"; | ||
import { render, screen } from "@testing-library/react"; | ||
|
||
test("renders the heading 'Upcoming'", () => { | ||
render( | ||
<UpcomingWidget | ||
interactions={interactionsTestData} | ||
contacts={contactsTestData} | ||
/> | ||
); | ||
|
||
const heading = screen.getByRole("heading", { | ||
level: 2, | ||
name: "Upcoming", | ||
}); | ||
|
||
expect(heading).toBeInTheDocument(); | ||
}); | ||
|
||
test("renders three upcoming interactions", () => { | ||
render( | ||
<UpcomingWidget | ||
interactions={threeFutureInteractionsTestData} | ||
contacts={contactsTestData} | ||
/> | ||
); | ||
|
||
const interactionItems = screen.getAllByRole("listitem"); | ||
|
||
expect(interactionItems).toHaveLength(3); | ||
}); |
12 changes: 12 additions & 0 deletions
12
components/DashboardWidgets/WelcomeMessageWidget/WelcomeMessageWidget.js
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,12 @@ | ||
import { StyledLink, StyledParagraph } from "./WelcomeMessageWidget.styled"; | ||
|
||
export default function WelcomeMessageWidget() { | ||
return ( | ||
<StyledParagraph> | ||
Welcome to Gunther - your Personal Relationship Management app. Manage | ||
your <StyledLink href="/contacts">contacts</StyledLink> and social{" "} | ||
<StyledLink href="/interactions">interactions</StyledLink> and cultivate a | ||
fulfilling network! | ||
</StyledParagraph> | ||
); | ||
} |
16 changes: 16 additions & 0 deletions
16
components/DashboardWidgets/WelcomeMessageWidget/WelcomeMessageWidget.styled.js
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,16 @@ | ||
import Link from "next/link"; | ||
import styled from "styled-components"; | ||
|
||
export const StyledParagraph = styled.p` | ||
line-height: 1.5rem; | ||
`; | ||
|
||
export const StyledLink = styled(Link)` | ||
color: var(--primary-text-color); | ||
text-decoration-color: var(--primary-color); | ||
text-underline-offset: 2px; | ||
&:active { | ||
background-color: var(--primary-color); | ||
} | ||
`; |
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
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,7 @@ | ||
import styled from "styled-components"; | ||
|
||
export const StyledUnorderedList = styled.ul` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 10px; | ||
`; |
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
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,5 +1,10 @@ | ||
import { StyledScopebox } from "./Scopebox.styled"; | ||
import { StyledHeading, StyledScopebox } from "./Scopebox.styled"; | ||
|
||
export default function Scopebox({ children }) { | ||
return <StyledScopebox>{children}</StyledScopebox>; | ||
export default function Scopebox({ children, heading }) { | ||
return ( | ||
<> | ||
{heading ? <StyledHeading>{heading}</StyledHeading> : null} | ||
<StyledScopebox>{children}</StyledScopebox> | ||
</> | ||
); | ||
} |
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
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
File renamed without changes.
Oops, something went wrong.