mirror of
https://github.com/tjsga/tj-sga-website-react.git
synced 2025-04-21 12:00:17 -04:00
Some more style changes
This commit is contained in:
parent
139c8a1102
commit
84fd33fffe
|
@ -43,6 +43,10 @@
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a.blue-button {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
.clickable-link {
|
.clickable-link {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
color: #38A3BD;
|
color: #38A3BD;
|
||||||
|
|
|
@ -18,11 +18,9 @@ export default function ArticleRow({
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='row'>
|
<div className='d-flex'>
|
||||||
<div className='article-row-thumbnail'>
|
<div className='article-row-thumbnail'>
|
||||||
{thumbUrl ? (
|
{thumbUrl ? <img src={thumbUrl} alt={article.title} /> : null}
|
||||||
<img className='mb-4' src={thumbUrl} alt={article.title} />
|
|
||||||
) : null}
|
|
||||||
</div>
|
</div>
|
||||||
<div className='article-row-content'>
|
<div className='article-row-content'>
|
||||||
<Link
|
<Link
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import imageUrl from '../imageUrl';
|
import imageUrl from '../imageUrl';
|
||||||
import BlockContent from '@sanity/block-content-to-react';
|
import BlockContent from '@sanity/block-content-to-react';
|
||||||
|
import '../css/article.css';
|
||||||
|
|
||||||
export default function InitiativeRow({
|
export default function InitiativeRow({
|
||||||
initiative,
|
initiative,
|
||||||
|
@ -13,16 +14,12 @@ export default function InitiativeRow({
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'flex' }}>
|
<div className='d-flex'>
|
||||||
<div style={{ flex: 1, padding: '10px' }}>
|
<div className='article-row-thumbnail'>
|
||||||
{thumbUrl ? (
|
{thumbUrl ? <img src={thumbUrl} alt={initiative.name} /> : null}
|
||||||
<img className='mb-4' src={thumbUrl} alt={initiative.name} />
|
|
||||||
) : null}
|
|
||||||
</div>
|
</div>
|
||||||
<div style={{ flex: 3, padding: '10px' }}>
|
<div className='article-row-content'>
|
||||||
<h3 className='header'>
|
<h3 className='header'>{initiative.name}</h3>
|
||||||
{initiative.name}
|
|
||||||
</h3>
|
|
||||||
<BlockContent blocks={initiative.content} />
|
<BlockContent blocks={initiative.content} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import React from 'react';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
import useQuery from '../hooks/useQuery';
|
import useQuery from '../hooks/useQuery';
|
||||||
import ArticleRow from './ArticleRow';
|
import ArticleRow from './ArticleRow';
|
||||||
|
|
||||||
|
@ -12,10 +14,11 @@ export default function RecentNews() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h3 className='text-center display-3'>Recent News</h3>
|
<h3 className='display-3'>Recent News</h3>
|
||||||
{news.map((article) => {
|
{news.map((article) => {
|
||||||
return <ArticleRow article={article} />;
|
return <ArticleRow article={article} />;
|
||||||
})}
|
})}
|
||||||
|
<Link to='/news'>All News</Link>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,17 +5,16 @@
|
||||||
|
|
||||||
.article-row-thumbnail {
|
.article-row-thumbnail {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 10px;
|
padding-top: 0.5em;
|
||||||
/*
|
padding-bottom: 0.5em;
|
||||||
To center the image
|
padding-right: 1em;
|
||||||
*/
|
|
||||||
/* display: flex;
|
|
||||||
align-items: center; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.article-row-content {
|
.article-row-content {
|
||||||
flex: 3;
|
flex: 3;
|
||||||
padding: 10px;
|
padding-top: 0.5em;
|
||||||
|
padding-bottom: 0.5em;
|
||||||
|
padding-right: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.article-paragraphs {
|
.article-paragraphs {
|
||||||
|
|
|
@ -3,10 +3,13 @@
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
line-height: 33px;
|
line-height: 33px;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.get-involved-title {
|
.get-involved-title {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
text-align: right;
|
||||||
|
padding-right: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.get-involved-description {
|
.get-involved-description {
|
||||||
|
|
|
@ -11,8 +11,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.mission-header {
|
.mission-header {
|
||||||
font-size: 1.25rem;
|
font-size: 2rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
text-align: right;
|
||||||
|
display: block;
|
||||||
|
padding-right: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mission-para {
|
.mission-para {
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.segment-title {
|
.segment-title {
|
||||||
margin: 10px 0px;
|
margin: 1em 0px;
|
||||||
font-weight: 600;
|
font-size: 1.75rem;
|
||||||
|
font-weight: 500;
|
||||||
}
|
}
|
|
@ -18,7 +18,7 @@ export default function GetInvolved() {
|
||||||
<>
|
<>
|
||||||
<Hero heading='Get Involved' />
|
<Hero heading='Get Involved' />
|
||||||
<main className='text-center'>
|
<main className='text-center'>
|
||||||
<h2>SGA Calendar</h2>
|
<h2 className='my-2'>SGA Calendar</h2>
|
||||||
<iframe
|
<iframe
|
||||||
src='https://calendar.google.com/calendar/u/0/embed?src=mbftfg4hu7i8ueqrgcb5o7hc6k@group.calendar.google.com&ctz=America/New_York'
|
src='https://calendar.google.com/calendar/u/0/embed?src=mbftfg4hu7i8ueqrgcb5o7hc6k@group.calendar.google.com&ctz=America/New_York'
|
||||||
title='SGA Calendar'
|
title='SGA Calendar'
|
||||||
|
|
|
@ -19,20 +19,19 @@ export default function Mission() {
|
||||||
— {mission.quote_author}
|
— {mission.quote_author}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className='row'>
|
<div className='d-flex'>
|
||||||
<div className='flex-1'>
|
<div className='flex-1 p-2'>
|
||||||
<span className='mission-header'>Vision</span>
|
<span className='mission-header'>Vision</span>
|
||||||
</div>
|
</div>
|
||||||
<div className='flex-2'>
|
<div className='flex-2 p-2'>
|
||||||
<p className='mission-para'>{mission.vision}</p>
|
<p className='mission-para'>{mission.vision}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<div className='d-flex'>
|
||||||
<div className='row'>
|
<div className='flex-1 p-2'>
|
||||||
<div className='flex-1'>
|
|
||||||
<span className='mission-header'>Mission</span>
|
<span className='mission-header'>Mission</span>
|
||||||
</div>
|
</div>
|
||||||
<div className='flex-2'>
|
<div className='flex-2 p-2'>
|
||||||
<p className='mission-para'>{mission.mission}</p>
|
<p className='mission-para'>{mission.mission}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,7 +7,9 @@ export default function News() {
|
||||||
<>
|
<>
|
||||||
<Hero heading='News' />
|
<Hero heading='News' />
|
||||||
<main>
|
<main>
|
||||||
|
<div style={{ paddingTop: '1em' }}>
|
||||||
<ArticleList />
|
<ArticleList />
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,38 +1,39 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Link, useParams } from 'react-router-dom';
|
import { Link, useParams } from 'react-router-dom';
|
||||||
import Hero from '../components/Hero';
|
import Hero from '../components/Hero';
|
||||||
import useQuery from '../hooks/useQuery';
|
|
||||||
import imageUrl from '../imageUrl';
|
import imageUrl from '../imageUrl';
|
||||||
import BlockContent from '@sanity/block-content-to-react';
|
import BlockContent from '@sanity/block-content-to-react';
|
||||||
|
import sanity from '../sanity';
|
||||||
import '../css/article.css';
|
import '../css/article.css';
|
||||||
|
|
||||||
export default function NewsArticle() {
|
export default function NewsArticle() {
|
||||||
let { articleId } = useParams<{ articleId: string }>();
|
let { articleId } = useParams<{ articleId: string }>();
|
||||||
let article = useQuery<SGA.ArticleDocument>('*[_id == $articleId] [0]', {
|
let [article, setArticle] = React.useState<SGA.ArticleDocument>(null!);
|
||||||
articleId,
|
|
||||||
});
|
|
||||||
|
|
||||||
let thumbUrl: string | undefined = undefined;
|
React.useEffect(() => {
|
||||||
|
sanity.fetch('*[_id == $articleId] [0]', { articleId }).then(setArticle);
|
||||||
|
}, [articleId]);
|
||||||
|
|
||||||
|
let thumbUrl: string | null = null;
|
||||||
if (article?.thumbnail) {
|
if (article?.thumbnail) {
|
||||||
thumbUrl = imageUrl(article.thumbnail).url() || undefined;
|
thumbUrl = imageUrl(article.thumbnail).url();
|
||||||
} else {
|
} else {
|
||||||
thumbUrl = '/images/hero.png';
|
thumbUrl = '/images/hero.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Hero heading='News' imageURL={thumbUrl} />
|
<Hero heading='News' imageURL={thumbUrl || undefined} />
|
||||||
<main>
|
<main>
|
||||||
|
{article ? (
|
||||||
|
<div style={{ maxWidth: '640px', margin: '2rem auto' }}>
|
||||||
<Link to='/news' className='clickable-link'>
|
<Link to='/news' className='clickable-link'>
|
||||||
Go to all news articles
|
Go to all news articles
|
||||||
</Link>
|
</Link>
|
||||||
<br />
|
|
||||||
{article ? (
|
|
||||||
<div style={{ maxWidth: '640px', margin: '2rem auto' }}>
|
|
||||||
<h1>{article.title}</h1>
|
<h1>{article.title}</h1>
|
||||||
<i className='text-sm'>{article.publish_date}</i>
|
<i>
|
||||||
<br />
|
Posted {article.publish_date} by {article.author || 'No author'}
|
||||||
<i>{article.author || 'No author'}</i>
|
</i>
|
||||||
<br />
|
<br />
|
||||||
{/* Wrap the BlockContent in a div because it expands to <></> */}
|
{/* Wrap the BlockContent in a div because it expands to <></> */}
|
||||||
<div className='article-paragraphs'>
|
<div className='article-paragraphs'>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user