Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the useful links on the public frontpage #3793

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added app/assets/frontpage-graphic-buddyweek.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/frontpage-graphic-data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/frontpage-graphic-for-companies.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/frontpage-graphic-komtek.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/frontpage-graphic-readme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions app/components/Button/Button.css
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,23 @@
cursor: pointer;
}

.ghost {
background: none;
box-shadow: none;
border: 1px solid var(--button-dark-background);
color: var(--button-dark-background);

&:focus-visible {
box-shadow: 0 0 0 3px var(--button-dark-box-shadow-focus);
}

&:hover:not(:disabled) {
background-color: var(--button-dark-background);
border-color: var(--button-dark-background);
color: var(--button-color);
}
}

.small {
padding: 10px 15px;
font-size: 0.8rem;
Expand Down
5 changes: 5 additions & 0 deletions app/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ type Props = {

/** Make it look like a link */
flat?: boolean;

/** Ghost button styling */
ghost?: boolean;
ivarnakken marked this conversation as resolved.
Show resolved Hide resolved
};

/**
Expand All @@ -53,6 +56,7 @@ function Button({
danger = false,
success = false,
flat = false,
ghost = false,
...rest
}: Props & ButtonHTMLAttributes<HTMLButtonElement>) {
return (
Expand All @@ -66,6 +70,7 @@ function Button({
dark && styles.dark,
danger && styles.danger,
success && styles.success,
ghost && styles.ghost,
className
)
}
Expand Down
1 change: 1 addition & 0 deletions app/components/Card/Card.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ html[data-theme='dark'] .danger a:hover {
.header {
font-weight: 600;
font-size: var(--font-size-large);
line-height: 1.3;
}
9 changes: 7 additions & 2 deletions app/components/Card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ import Flex from 'app/components/Layout/Flex';
import styles from './Card.css';
import type { HTMLAttributes, ReactNode } from 'react';

const CardHeader = ({ children }: { children: ReactNode }) => (
<div className={styles.header}>{children}</div>
type CardHeaderProps = {
children: ReactNode;
className?: string;
};

const CardHeader = ({ children, className }: CardHeaderProps) => (
<div className={cx(styles.header, className)}>{children}</div>
);

type Props = {
Expand Down
36 changes: 13 additions & 23 deletions app/routes/overview/components/PublicFrontpage.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,23 @@
margin: auto;
}

.facebookIframeContainer {
width: 100%;
display: flex;
justify-content: center;
.usefulLink {
width: 325px;
height: 400px;
line-height: 1.3;
}

.facebookIframe {
border: none;
overflow: hidden;
height: 500px;
width: 340px;
.usefulLinkHeader {
height: 14%;
}

.usefulLinks {
composes: rootCardStyle;
flex: 1.8;
margin-right: 30px;
.usefulLinkDescription {
color: var(--lego-font-color);
height: 30%;
}

.usefulLinks a {
font-size: 20px;
}

.usefulLinks li {
margin-bottom: 15px;
}

.linkDescription {
margin-left: 30px;
.usefulLinkGraphic {
margin: 0 auto;
width: auto;
height: 40%;
}
133 changes: 79 additions & 54 deletions app/routes/overview/components/PublicFrontpage.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import { Link } from 'react-router-dom';
import buddyWeekGraphic from 'app/assets/frontpage-graphic-buddyweek.png';
import dataGraphic from 'app/assets/frontpage-graphic-data.png';
import forCompaniesGraphic from 'app/assets/frontpage-graphic-for-companies.png';
import komtekGraphic from 'app/assets/frontpage-graphic-komtek.png';
import readmeGraphic from 'app/assets/frontpage-graphic-readme.png';
import netcompany from 'app/assets/netcompany_dark.png';
import AuthSection from 'app/components/AuthSection/AuthSection';
import Button from 'app/components/Button';
import Card from 'app/components/Card';
import { Image } from 'app/components/Image';
import { Container } from 'app/components/Layout';
import { Container, Flex } from 'app/components/Layout';
import { readmeIfy } from 'app/components/ReadmeLogo';
import type { Readme } from 'app/models';
import type { WithDocumentType } from 'app/reducers/frontpage';
Expand Down Expand Up @@ -67,10 +72,8 @@ const PublicFrontpage = ({ frontpage, readmes }: Props) => {
collapsible={false}
style={{ gridArea: 'readme' }}
/>
<Card style={{ gridArea: 'links' }}>
<UsefulLinks />
</Card>
</Container>
<UsefulLinks />
</Container>
);
};
Expand Down Expand Up @@ -116,59 +119,81 @@ const LatestArticle = ({ frontpage }: Pick<Props, 'frontpage'>) => (
</>
);

const usefulLinksConf = [
{
title: 'Fadderperioden 2022',
image: buddyWeekGraphic,
description:
'Abakus arrangerer fadderperioden for alle nye studenter, og her finner du informasjon om fadderperioden 2022.',
buttonText: 'Les deg opp',
link: '/articles/414',
isInternalLink: true,
},
{
title: 'Datateknologi',
image: dataGraphic,
description:
'Datateknologi er en helt sentral del av alle fremtidsrettede teknologier; som for eksempel kunstig intelligens, medisinsk teknologi og søkemotorteknologi.',
buttonText: 'Sjekk ut studiet',
link: 'https://www.ntnu.no/studier/mtdt',
isInternalLink: false,
},
{
title: 'Kommunikasjonsteknologi og digital sikkerhet',
image: komtekGraphic,
description:
'Vi bruker stadig mer av livene våre på nett, på jobb som i fritid. Kommunikasjonsteknologi og digital sikkerhet blir stadig viktigere i en digital verden.',
buttonText: 'Sjekk ut studiet',
link: 'https://www.ntnu.no/studier/mtkom',
isInternalLink: false,
},
{
title: 'For bedrifter',
image: forCompaniesGraphic,
description:
"Her finner du som bedriftsrepresentant informasjon om Abakus' prosedyrer for bedriftspresentasjoner, og andre nyttige fakta.",
buttonText: 'Undersøk muligheter',
link: '/pages/bedrifter/for-bedrifter',
isInternalLink: true,
},
{
title: 'readme',
image: readmeGraphic,
description:
'Abakus har sitt eget magasin, readme. Her kan du lese om hva vi driver med, og få et innblikk i oss som organisasjon.',
buttonText: 'Utforsk magasiner',
link: 'https://readme.abakus.no/',
isInternalLink: false,
},
];

const UsefulLinks = () => (
<>
<h2 className="u-mb">Nyttige lenker</h2>
<ul>
<li>
<Link to="/articles/414">
<i className="fa fa-caret-right" /> Fadderperioden 2022
</Link>
<div className={styles.linkDescription}>
Informasjon om fadderperioden 2022
</div>
</li>
<li>
<a href="https://www.ntnu.no/studier/mtdt" target="blank">
<i className="fa fa-caret-right" /> Datateknologi
</a>
<div className={styles.linkDescription}>
Datateknologi er en helt sentral del av alle fremtidsrettede
teknologier, som for eksempel kunstig intelligens, medisinsk teknologi
og søkemotorteknologi.
</div>
</li>
<li>
<a href="http://www.ntnu.no/studier/mtkom" target="blank">
<i className="fa fa-caret-right" /> Kommunikasjonsteknologi og digital
sikkerhet
</a>
<div className={styles.linkDescription}>
Vi bruker stadig mer av livene våre på nett, på jobb som i fritid.
Kommunikasjonsteknologi og digital sikkerhet blir stadig viktigere i
en digital verden.
</div>
</li>
<li>
<Link to="/pages/bedrifter/for-bedrifter">
<i className="fa fa-caret-right" /> For bedrifter
</Link>
<div className={styles.linkDescription}>
Her finner du som bedriftsrepresentant informasjon om Abakus{"' "}
prosedyrer for bedriftspresentasjoner og andre nyttige fakta.
</div>
</li>
<li>
<a href="https://readme.abakus.no">
<i className="fa fa-caret-right" /> {readmeIfy('readme')}

<Flex wrap justifyContent="center" gap={40}>
{usefulLinksConf.map((item) => (
<a
href={item.link}
key={item.title}
rel="noreferrer"
target={item.isInternalLink ? '_self' : '_blank'}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of this over using Link for the internal ones but I can let it slide.

>
<Card isHoverable className={styles.usefulLink}>
<Card.Header className={styles.usefulLinkHeader}>
{readmeIfy(item.title)}
</Card.Header>
<Image
src={item.image}
alt={item.title}
className={styles.usefulLinkGraphic}
/>
<p className={styles.usefulLinkDescription}>{item.description}</p>
<Button ghost>{item.buttonText}</Button>
</Card>
</a>
<div className={styles.linkDescription}>
Abakus har sitt eget magasin skrevet av {readmeIfy('readme')}. Her kan
du lese om hva abakus driver med og få et innblikk i abakus som
organisasjon.
</div>
</li>
</ul>
))}
</Flex>
</>
);

Expand Down