Skip to content

Commit

Permalink
Stack@Illinois! (#256)
Browse files Browse the repository at this point in the history
* Rebrand to Stack@Illinois

* Auto-kill the joke at midnight

* Meme page title
  • Loading branch information
nwalters512 authored Apr 1, 2019
1 parent f25ee3e commit a33310f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
16 changes: 14 additions & 2 deletions src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
Button,
} from 'reactstrap'
import { connect } from 'react-redux'
import moment from 'moment'

import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faUser } from '@fortawesome/free-solid-svg-icons'
Expand Down Expand Up @@ -52,12 +53,23 @@ class Header extends React.Component {
// on the login page. If that's the case, disable the link to the homepage
// so they can't cycle repeatedly back and forth between that and the
// login page
let brandText
if (moment().isAfter('2019-04-02T00:00:00-0500')) {
brandText = 'Queue@Illinois'
} else {
brandText = (
<>
<span style={{ textDecoration: 'line-through' }}>Queue</span>
Stack@Illinois
</>
)
}
const brandLink = user ? (
<Link route="index" passHref>
<NavbarBrand>Queue@Illinois</NavbarBrand>
<NavbarBrand>{brandText}</NavbarBrand>
</Link>
) : (
<NavbarBrand tag="span">Queue@Illinois</NavbarBrand>
<NavbarBrand tag="span">{brandText}</NavbarBrand>
)

return (
Expand Down
21 changes: 21 additions & 0 deletions src/components/StackRebrandingAlert.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react'
import { Alert } from 'reactstrap'
import moment from 'moment'

const StackRebrandingAlert = () => {
// Hide alert after April Fool's day
if (moment().isAfter('2019-04-02 00:00:00.000-05')) return null

return (
<Alert color="primary" fade={false}>
<span className="mr-3">We&apos;re rebranding to Stack@Illinois!</span>
<strong>
<a href="https://queue.illinois.edu/blog/stack">
Read&nbsp;more&nbsp;→
</a>
</strong>
</Alert>
)
}

export default StackRebrandingAlert
4 changes: 3 additions & 1 deletion src/pages/_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from 'react'
import Document, { Head, Main, NextScript } from 'next/document'
import flush from 'styled-jsx/server'
import { dom } from '@fortawesome/fontawesome-svg-core'
import moment from 'moment'

import { baseUrl, isDev, isNow } from '../util'

Expand All @@ -27,6 +28,7 @@ export default class MyDocument extends Document {
}
const faviconPath = `${baseUrl}/static/favicon.ico`
const manifestPath = `${baseUrl}/static/manifest.json`
const isAprilFools = moment().isBefore('2019-04-02 00:00:00.000-05')
return (
<html lang="en">
<Head>
Expand All @@ -46,7 +48,7 @@ export default class MyDocument extends Document {
crossOrigin="use-credentials"
href={manifestPath}
/>
<title>Queue@Illinois</title>
<title>{isAprilFools ? 'Stack@Illinois' : 'Queue@Illinois'}</title>
<style>{dom.css()}</style>
<link rel="icon" href={faviconPath} type="image/png" />
<script dangerouslySetInnerHTML={script} />
Expand Down
2 changes: 2 additions & 0 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import NewQueue from '../components/NewQueue'
import ShowForAdmin from '../components/ShowForAdmin'
import DevWorkshopAd from '../components/DevWorkshopAd'
import QueueCardListContainer from '../containers/QueueCardListContainer'
import StackRebrandingAlert from '../components/StackRebrandingAlert'

class Index extends React.Component {
static async getInitialProps({ store, isServer }) {
Expand Down Expand Up @@ -113,6 +114,7 @@ class Index extends React.Component {
<Fragment>
<Container>
<DevWorkshopAd />
<StackRebrandingAlert />
<div className="d-flex flex-wrap align-items-center mb-4">
<h1 className="display-4 d-inline-block mb-0 mt-3 mr-auto pr-3">
Open queues
Expand Down

0 comments on commit a33310f

Please sign in to comment.