Skip to content

Commit

Permalink
Fix requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Magnus Brecke committed Sep 27, 2024
1 parent 1435ca0 commit e2db5cf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
13 changes: 3 additions & 10 deletions app/components/EventItem/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Button, Flex, Icon, Image, LinkButton } from '@webkom/lego-bricks';
import cx from 'classnames';
import { Flex, Icon, Image } from '@webkom/lego-bricks';
import {
AlarmClock,
Calendar,
Expand All @@ -19,7 +18,6 @@ import { eventAttendanceAbsolute } from 'app/utils/eventStatus';
import styles from './styles.css';
import type { ListEvent } from 'app/store/models/Event';
import type { ReactNode } from 'react';
import { useState } from 'react';

export type EventStyle = 'default' | 'extra-compact' | 'compact';

Expand Down Expand Up @@ -129,7 +127,6 @@ const EventItem = ({
showTags = true,
eventStyle,
}: EventItemProps): ReactNode => {
const [hover, setHover] = useState(false);
switch (eventStyle) {
case 'extra-compact':
return (
Expand Down Expand Up @@ -206,12 +203,10 @@ const EventItem = ({
return (
<Link
to={`/events/${event.slug}`}
onMouseEnter={() => setHover(true)}
onMouseLeave={() => setHover(false)}
style={{
borderColor: colorForEventType(event.eventType),
}}
className={cx(styles.eventItem, hover && styles.eventItemHover)}
className={styles.eventItem}
>
<div>
<h3 className={styles.eventItemTitle}>{event.title}</h3>
Expand All @@ -226,9 +221,7 @@ const EventItem = ({
)}
</div>

<Flex
className={cx(styles.companyLogo, hover && styles.companyLogoHover)}
>
<Flex className={styles.companyLogo}>
{event.cover && (
<Image
alt="Forsidebilde"
Expand Down
14 changes: 8 additions & 6 deletions app/components/EventItem/styles.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.eventItem {
min-height: 50px;
padding: var(--spacing-xs);
padding-left: var(--spacing-md);
border-left: 4px solid transparent;
margin-bottom: var(--spacing-md);
Expand All @@ -9,10 +10,11 @@
transition: var(--easing-fast);
}

.eventItemHover {
.eventItem:hover {
background-color: var(--additive-background);
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
/* border-top-right-radius: var(--border-radius-sm);
border-bottom-right-radius: var(--border-radius-sm); */
border-radius: var(--border-radius-sm);
}

.eventItemCompact {
Expand Down Expand Up @@ -55,12 +57,12 @@
max-height: 80px;
object-fit: contain;
background: white;
margin: 5px 10px 5px 0;
margin: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) 0;
transition: var(--easing-fast);
}

.companyLogoHover img {
border-radius: 10px;
.eventItem:hover .companyLogo img {
border-radius: var(--border-radius-sm);
}

.companyLogoCompact img {
Expand Down

0 comments on commit e2db5cf

Please sign in to comment.