Skip to content

Commit

Permalink
tell users to send feedback if they have no feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
SheepTester committed Mar 31, 2024
1 parent 14df1fb commit d4d05eb
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 22 deletions.
49 changes: 29 additions & 20 deletions src/components/events/Feedback/style.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,29 @@
flex-direction: column;

.header {
align-items: center;
background-color: var(--theme-elevated-background);
border-bottom: 1px solid var(--theme-elevated-stroke);
border-radius: 0.5rem 0.5rem 0 0;
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
padding: 0.5rem;
position: relative;

.user,
.event {
align-items: center;
display: flex;
gap: 0.5rem;
padding: 0.5rem;
position: relative;

&:hover span {
text-decoration: underline;
}
}

.user {
img {
border-radius: 50%;
}

&::after {
background-color: var(--theme-background);
border-right: 1px solid var(--theme-elevated-stroke);
border-top: 1px solid var(--theme-elevated-stroke);
content: '';
height: 0.5rem;
left: 1.25rem;
margin: -0.25rem;
position: absolute;
top: 100%;
transform: rotate(-45deg);
width: 0.5rem;
}
.user img {
border-radius: 50%;
}

.event img {
Expand All @@ -52,6 +39,20 @@
> span {
margin: auto 0;
}

&::after {
background-color: var(--theme-background);
border-right: 1px solid var(--theme-elevated-stroke);
border-top: 1px solid var(--theme-elevated-stroke);
content: '';
height: 0.5rem;
left: 1.25rem;
margin: -0.25rem;
position: absolute;
top: 100%;
transform: rotate(-45deg);
width: 0.5rem;
}
}

.body {
Expand Down Expand Up @@ -82,6 +83,10 @@
gap: 0.5rem;
justify-content: space-between;

@media (max-width: vars.$breakpoint-sm) {
flex-direction: row;
}

.button {
border-radius: 2rem;
color: var(--theme-background);
Expand All @@ -90,6 +95,10 @@
height: 2rem;
padding: 0 1rem;

@media (max-width: vars.$breakpoint-sm) {
flex: auto;
}

&.acknowledge {
background-color: var(--theme-primary-2);
}
Expand Down
14 changes: 13 additions & 1 deletion src/pages/feedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { CookieType, FeedbackStatus, FeedbackType, UserAccessType } from '@/lib/
import { isEnum } from '@/lib/utils';
import styles from '@/styles/pages/feedback.module.scss';
import type { GetServerSideProps } from 'next';
import Link from 'next/link';
import { useMemo, useState } from 'react';

type FilterOptions = {
Expand Down Expand Up @@ -130,7 +131,18 @@ const FeedbackPage = ({ user, feedback, token, initialFilters }: FeedbackPagePro
pages={Math.ceil(filteredFeedback.length / ROWS_PER_PAGE)}
/>
) : (
<Typography variant="body/medium">No feedback matches these criteria.</Typography>
<Typography variant="body/medium">
{typeFilter !== 'any' || statusFilter !== 'any' ? (
'No feedback matches these criteria.'
) : (
<>
You haven&lsquo;t submitted any feedback yet!{' '}
<Link href={`${config.eventsRoute}?attendance=attended`} className={styles.link}>
Review your recent events.
</Link>
</>
)}
</Typography>
)}
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const PortalHomePage = ({
const newAttendance: PublicAttendance = {
user: user,
event,
timestamp: new Date(),
timestamp: new Date().toString(),
asStaff: false,
feedback: [],
};
Expand Down
8 changes: 8 additions & 0 deletions src/styles/pages/feedback.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,12 @@
}
}
}

.link {
color: var(--theme-blue-text-button);

&:hover {
text-decoration: underline;
}
}
}
1 change: 1 addition & 0 deletions src/styles/pages/feedback.module.scss.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export type Styles = {
controls: string;
filterOption: string;
link: string;
page: string;
};

Expand Down

0 comments on commit d4d05eb

Please sign in to comment.