event page progress, date list redesign and details grid
This commit is contained in:
@ -20,10 +20,10 @@ const DateListItem = ({ occurrence }: { occurrence: EventOccurrence }) => {
|
||||
<div className={styles.time}>
|
||||
<span className={styles.day}>
|
||||
{formatExtendedDateTime(occurrence.start, true)}
|
||||
</span>
|
||||
</span>{" "}
|
||||
<span className={styles.hour}>
|
||||
{formatDate(occurrence.start, timeFormat)}
|
||||
</span>
|
||||
</span>{" "}
|
||||
<span className={styles.venue}>
|
||||
{occurrence.venue?.preposition + " " ?? ""}
|
||||
{occurrence.venue?.url && (
|
||||
@ -50,13 +50,19 @@ export const DateList = ({ event }: { event: EventFragment }) => {
|
||||
// TODO: end date/time?
|
||||
// TODO: past occurrences?
|
||||
|
||||
const [showAllDates, setShowAllDates] = useState(false);
|
||||
function toggleDates() {
|
||||
setShowAllDates(!showAllDates)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={styles.dateWrapper}>
|
||||
<h2 className="suphead">
|
||||
Kommende datoer{" "}
|
||||
<span className="number">({futureOccurrences.length})</span>
|
||||
</h2>
|
||||
<ul className={styles.dateList}>
|
||||
<div className={`${styles.header} suphead`}>
|
||||
<span>Dato</span>
|
||||
<span>Tid</span>
|
||||
<span>Sted</span>
|
||||
</div>
|
||||
<ul className={styles.dateList} data-showAll={showAllDates}>
|
||||
{futureOccurrences.map((occurrence) => (
|
||||
<DateListItem
|
||||
key={occurrence.id}
|
||||
@ -64,6 +70,11 @@ export const DateList = ({ event }: { event: EventFragment }) => {
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
{futureOccurrences.length > 4 && (<div className={styles.showMore}>
|
||||
<button onClick={() => toggleDates()} className="button tertiary">
|
||||
<span>Vis alle kommende datoer ({futureOccurrences.length})</span>
|
||||
</button>
|
||||
</div>)}
|
||||
{/* <div onClick={() => setShowPast(!showPast)}>
|
||||
{showPast ? "Skjul" : "Vis"} tidligere
|
||||
</div>
|
||||
|
@ -27,48 +27,54 @@ export const EventDetails = ({ event }: { event: EventFragment }) => {
|
||||
return (
|
||||
<div className={styles.eventDetails}>
|
||||
<div className={styles.content}>
|
||||
<div className={styles.prices}>
|
||||
<span className="suphead">Pris</span>
|
||||
<ul className={styles.priceList}>
|
||||
{event.free && (
|
||||
<li className={styles.priceItem}>
|
||||
<span>Gratis</span>
|
||||
</li>
|
||||
)}
|
||||
{event.priceRegular && (
|
||||
<li className={styles.priceItem}>
|
||||
<span className={styles.priceLabel}>Ordinær</span>{" "}
|
||||
{formatPrice(event.priceRegular)}
|
||||
</li>
|
||||
)}
|
||||
{event.priceStudent && (
|
||||
<li className={styles.priceItem}>
|
||||
<span className={styles.priceLabel}>Student</span>{" "}
|
||||
{formatPrice(event.priceStudent)}
|
||||
</li>
|
||||
)}
|
||||
{event.priceMember && (
|
||||
<li className={styles.priceItem}>
|
||||
<span className={styles.priceLabel}>Medlem</span>{" "}
|
||||
{formatPrice(event.priceMember)}
|
||||
</li>
|
||||
)}
|
||||
</ul>
|
||||
</div>
|
||||
{event.organizers.length !== 0 && (
|
||||
<div>
|
||||
<div className="suphead">Arrangeres av</div>{" "}
|
||||
<OrganizerList event={event} />
|
||||
<div className={styles.info}>
|
||||
<div className={styles.prices}>
|
||||
<h2 className="suphead">Pris</h2>
|
||||
<ul className={styles.priceList}>
|
||||
{event.free && (
|
||||
<li className={styles.priceItem}>
|
||||
<span className={styles.priceLabel}>Gratis</span>
|
||||
</li>
|
||||
)}
|
||||
{event.priceRegular && (
|
||||
<li className={styles.priceItem}>
|
||||
<span className={styles.priceLabel}>Ordinær</span>{" "}
|
||||
{formatPrice(event.priceRegular)}
|
||||
</li>
|
||||
)}
|
||||
{event.priceStudent && (
|
||||
<li className={styles.priceItem}>
|
||||
<span className={styles.priceLabel}>Student</span>{" "}
|
||||
{formatPrice(event.priceStudent)}
|
||||
</li>
|
||||
)}
|
||||
{event.priceMember && (
|
||||
<li className={styles.priceItem}>
|
||||
<span className={styles.priceLabel}>Medlem</span>{" "}
|
||||
{formatPrice(event.priceMember)}
|
||||
</li>
|
||||
)}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
{event.facebookUrl && (
|
||||
<a href={event.facebookUrl} className="button tertiary">
|
||||
<span>Gå til Facebook-event</span>
|
||||
<Icon type="externalLink" />
|
||||
</a>
|
||||
)}
|
||||
{event.organizers.length !== 0 && (
|
||||
<div>
|
||||
<h2 className="suphead">Arrangeres av</h2>{" "}
|
||||
<OrganizerList event={event} />
|
||||
</div>
|
||||
)}
|
||||
{event.facebookUrl && (
|
||||
<div>
|
||||
<a href={event.facebookUrl} className="button tertiary">
|
||||
<span>Gå til Facebook-event</span>
|
||||
<Icon type="externalLink" />
|
||||
</a>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className={styles.dateList}>
|
||||
<DateList event={event} />
|
||||
</div>
|
||||
</div>
|
||||
<DateList event={event} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
@ -1,28 +1,48 @@
|
||||
.dateWrapper {
|
||||
margin-top: var(--spacing-m);
|
||||
}
|
||||
|
||||
.dateList {
|
||||
list-style: none;
|
||||
margin-top: var(--spacing-xs);
|
||||
|
||||
&[data-showall=true] {
|
||||
.date {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.date {
|
||||
display: inline-block;
|
||||
width: 14em;
|
||||
display: block;
|
||||
width: 100%;
|
||||
font-family: var(--font-serif);
|
||||
font-size: var(--font-size-caption);
|
||||
font-size: var(--font-size-body);
|
||||
position: relative;
|
||||
line-height: 1.4;
|
||||
padding: 0 2rem 1rem 0;
|
||||
padding: var(--spacing-s) 0;
|
||||
border-bottom: var(--border);
|
||||
|
||||
display: none;
|
||||
|
||||
&:nth-of-type(1), &:nth-of-type(2), &:nth-of-type(3), &:nth-of-type(4) {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.header {
|
||||
border-bottom: var(--border);
|
||||
padding-bottom: var(--spacing-xs);
|
||||
margin-bottom: 0 !important;
|
||||
font-family: var(--font-main);
|
||||
font-size: var(--font-size-caption);
|
||||
}
|
||||
|
||||
.header,
|
||||
.time {
|
||||
width: 100%;
|
||||
display: grid;
|
||||
grid-template-columns: 3fr 1fr 2fr;
|
||||
gap: var(--spacing-m);
|
||||
}
|
||||
|
||||
.day {
|
||||
display: block;
|
||||
display: inline-block;
|
||||
|
||||
&:first-letter {
|
||||
text-transform: capitalize;
|
||||
@ -36,4 +56,8 @@
|
||||
.venue {
|
||||
display: inline-block;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.showMore {
|
||||
margin-top: var(--spacing-s);
|
||||
}
|
@ -1,20 +1,36 @@
|
||||
.eventDetails {
|
||||
background: var(--color-background-secondary);
|
||||
margin: 0 calc(var(--spacing-sitepadding-inline)*-1) var(--spacing-sitepadding-block);
|
||||
padding: var(--spacing-s) var(--spacing-sitepadding-inline) var(--spacing-m);
|
||||
padding: var(--spacing-m) var(--spacing-sitepadding-inline) var(--spacing-m);
|
||||
font-family: var(--font-serif);
|
||||
|
||||
h2 {
|
||||
font-family: var(--font-main);
|
||||
margin-bottom: var(--spacing-xs);
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
column-gap: var(--spacing-gap-column);
|
||||
row-gap: var(--spacing-gap-row);
|
||||
margin-bottom: var(--spacing-gap-row);
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.info {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
column-gap: var(--spacing-gap-column);
|
||||
row-gap: var(--spacing-m);
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.priceList {
|
||||
list-style: none;
|
||||
max-width: 10rem;
|
||||
max-width: 13rem;
|
||||
}
|
||||
|
||||
.priceItem {
|
||||
@ -35,8 +51,24 @@
|
||||
width: 7rem;
|
||||
}
|
||||
|
||||
.dateList {
|
||||
grid-column: span 2;
|
||||
}
|
||||
|
||||
@media (max-width: 800px) {
|
||||
.content {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
|
||||
.info, .dateList {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
.dateList {
|
||||
order: 1;
|
||||
}
|
||||
|
||||
.info {
|
||||
order: 2;
|
||||
}
|
||||
}
|
@ -19,6 +19,7 @@
|
||||
|
||||
.image {
|
||||
grid-column: span 2;
|
||||
margin-bottom: -.4rem;
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
@ -33,7 +34,7 @@
|
||||
margin: var(--spacing-xs) 0 var(--spacing-l);
|
||||
}
|
||||
|
||||
@media (max-width: 800px) {
|
||||
@media (max-width: 1000px) {
|
||||
.eventHeader {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
@ -26,8 +26,8 @@ button,
|
||||
|
||||
&.cta {
|
||||
padding: calc(var(--spacing-xs)*1.5) calc(var(--spacing-s)*1.5);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
display: inline-flex;
|
||||
gap: 2rem;
|
||||
font-size: var(--font-size-body);
|
||||
>div {
|
||||
font-size: var(--font-size-lead);
|
||||
|
@ -75,14 +75,14 @@
|
||||
--border-s: 1px solid var(--color-chateauBlue-05);
|
||||
}
|
||||
|
||||
@media (min-width: 1800px) {
|
||||
@media (min-width: 1400px) {
|
||||
:root {
|
||||
--spacing-sitepadding-block: 2.4rem;
|
||||
--spacing-sitepadding-inline: 6rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 2000px) {
|
||||
@media (min-width: 1800px) {
|
||||
:root {
|
||||
--spacing-sitepadding-block: 3rem;
|
||||
--spacing-sitepadding-inline: 10rem;
|
||||
|
Reference in New Issue
Block a user