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