diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ddf8c38..30ec4d3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,6 +6,7 @@ name: Deploy on: push: branches: [master] + workflow_dispatch: jobs: build: @@ -13,7 +14,7 @@ jobs: strategy: matrix: - node-version: [10.x, 12.x] + node-version: [16.x] steps: - uses: actions/checkout@v2 # on the runner, check out this code on @@ -26,3 +27,4 @@ jobs: - run: pm2 reload flamingo # reloads on the DigitalOcean droplet env: CI: true + ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true diff --git a/.github/workflows/new_deploy.yml b/.github/workflows/new_deploy.yml new file mode 100644 index 0000000..7da5773 --- /dev/null +++ b/.github/workflows/new_deploy.yml @@ -0,0 +1,58 @@ +name: Deploy + +on: + push: + branches: [master] + workflow_dispatch: + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Install dependencies + run: yarn install + + - name: Build project + run: yarn build + + - name: Set up Docker + uses: docker/setup-buildx-action@v3 + + - name: Log in to DigitalOcean + run: echo "${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}" | docker login -u "doctl" --password-stdin registry.digitalocean.com + + - name: Build and push Docker image + run: | + docker buildx build --platform linux/amd64,linux/arm64 \ + --tag registry.digitalocean.com/dailybruin/dbonline:latest \ + --push . + + - name: Install doctl + run: | + curl -sL https://github.com/digitalocean/doctl/releases/download/v1.99.0/doctl-1.99.0-linux-amd64.tar.gz | tar -xzv + sudo mv doctl /usr/local/bin/ + + - name: Authenticate doctl + run: | + doctl auth init --access-token ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Write kubeconfig to file + run: | + echo "${{ secrets.KUBECONFIG }}" > kubeconfig.yaml + + - name: Update Kubernetes deployment + env: + KUBECONFIG: kubeconfig.yaml + run: | + kubectl set image deployment/flamingo flamingo=registry.digitalocean.com/dailybruin/dbonline:latest + kubectl rollout status deployment/flamingo + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..344d890 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM node:16.20.2 + +RUN apt-get update && apt-get install -y \ + yarn + +WORKDIR /usr/src/flamingo + +COPY .next ./.next + +COPY node_modules ./node_modules + +COPY package.json . + +COPY yarn.lock . + +EXPOSE 1919 + +CMD ["yarn", "deploy"] \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..90ae0c1 --- /dev/null +++ b/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +yarn build +docker build --platform="linux/amd64" -t registry.digitalocean.com/dailybruin/flamingotestedamd64:latest . +docker push registry.digitalocean.com/dailybruin/flamingotestedamd64:latest \ No newline at end of file diff --git a/components/Article/index.jsx b/components/Article/index.jsx index 66b66a4..2b77f12 100644 --- a/components/Article/index.jsx +++ b/components/Article/index.jsx @@ -1,6 +1,6 @@ import * as React from "react"; import Link from "next/link"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import moment from "moment"; @@ -25,7 +25,6 @@ export default class Article extends React.Component { // quick patch to prevent attempting to load an author that was not properly fetched. continue; } - console.log(author); authorPictures.push( +
+ + +

+ {utilities.renderAuthors(props.authors)} +

+
+ + + {PostTime.toLocaleString()} + + + {TimeDiff} + +
+
+
+
+ {props.imageurl != "http://wp.dailybruin.com/images/2017/03/db-logo.png" && + +
+ +
+ /*

+ {props.photographer} +

*/ + } + +
+ ); +} diff --git a/components/ArticleCard/BreakingOverview.jsx b/components/ArticleCard/BreakingOverview.jsx new file mode 100644 index 0000000..5124346 --- /dev/null +++ b/components/ArticleCard/BreakingOverview.jsx @@ -0,0 +1,102 @@ +import * as React from "react"; +import Link from "next/link"; +/** @jsxImportSource @emotion/react */ +import { css, jsx } from "@emotion/core"; +import * as globals from "../globals"; +import * as locals from "./locals"; +import * as utilities from "./utilities"; +import * as moment from "moment"; + +export default function BreakingOverview(props) { + return ( +
+
+ + +

+ {"What we're covering here"} +

+
+
+
+
+ {props.imageurl != "http://wp.dailybruin.com/images/2017/03/db-logo.png" && + +
+ +
+ /*

+ {props.photographer} +

*/ + } + +
+ ); +} diff --git a/components/ArticleCard/Full.jsx b/components/ArticleCard/Full.jsx index 8259ca0..d1a3056 100644 --- a/components/ArticleCard/Full.jsx +++ b/components/ArticleCard/Full.jsx @@ -1,6 +1,6 @@ import * as React from "react"; import Link from "next/link"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; import * as locals from "./locals"; diff --git a/components/ArticleCard/Horz.jsx b/components/ArticleCard/Horz.jsx index 9cc6184..4f642a3 100644 --- a/components/ArticleCard/Horz.jsx +++ b/components/ArticleCard/Horz.jsx @@ -1,6 +1,6 @@ import * as React from "react"; import Link from "next/link"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; import * as locals from "./locals"; diff --git a/components/ArticleCard/Long.jsx b/components/ArticleCard/Long.jsx index 2f9234c..cf8b1d8 100644 --- a/components/ArticleCard/Long.jsx +++ b/components/ArticleCard/Long.jsx @@ -1,5 +1,5 @@ import * as React from "react"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; import * as locals from "./locals"; diff --git a/components/ArticleCard/Mini.jsx b/components/ArticleCard/Mini.jsx index 3467fca..e6791e6 100644 --- a/components/ArticleCard/Mini.jsx +++ b/components/ArticleCard/Mini.jsx @@ -1,6 +1,6 @@ import * as React from "react"; import Link from "next/link"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; import * as locals from "./locals"; diff --git a/components/ArticleCard/Podcast.jsx b/components/ArticleCard/Podcast.jsx index 02ad4d6..48e39b5 100644 --- a/components/ArticleCard/Podcast.jsx +++ b/components/ArticleCard/Podcast.jsx @@ -1,6 +1,6 @@ import * as React from "react"; import Link from "next/link"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; import * as locals from "./locals"; diff --git a/components/ArticleCard/Vert.jsx b/components/ArticleCard/Vert.jsx index c8358dc..de002ea 100644 --- a/components/ArticleCard/Vert.jsx +++ b/components/ArticleCard/Vert.jsx @@ -1,6 +1,6 @@ import * as React from "react"; import Link from "next/link"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; import * as locals from "./locals"; diff --git a/components/ArticleCard/Video.jsx b/components/ArticleCard/Video.jsx index c90fcec..e14df1a 100644 --- a/components/ArticleCard/Video.jsx +++ b/components/ArticleCard/Video.jsx @@ -1,6 +1,6 @@ import * as React from "react"; import Link from "next/link"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; import * as locals from "./locals"; diff --git a/components/ArticleCard/index.jsx b/components/ArticleCard/index.jsx index 5921b63..a000642 100644 --- a/components/ArticleCard/index.jsx +++ b/components/ArticleCard/index.jsx @@ -8,6 +8,8 @@ import Full from "./Full"; import Mini from "./Mini"; import Video from "./Video"; import Podcast from "./Podcast"; +import Breaking from "./Breaking"; +import BreakingOverview from "./BreakingOverview" export default class ArticleCard extends React.Component { constructor(props) { @@ -38,6 +40,12 @@ export default class ArticleCard extends React.Component { case "podcast": card = ; break; + case "breaking": + card = ; + break; + case "breakingOverview": + card = ; + break; default: card = ; } diff --git a/components/ArticleCarousel/index.jsx b/components/ArticleCarousel/index.jsx index d65c09c..fb45318 100644 --- a/components/ArticleCarousel/index.jsx +++ b/components/ArticleCarousel/index.jsx @@ -1,5 +1,5 @@ import React from "react"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import SwipeableViews from "react-swipeable-views"; import { autoPlay } from "react-swipeable-views-utils"; diff --git a/components/AuthorCard/index.jsx b/components/AuthorCard/index.jsx index 8765654..369b101 100644 --- a/components/AuthorCard/index.jsx +++ b/components/AuthorCard/index.jsx @@ -1,5 +1,5 @@ import * as React from "react"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; import emailImage from "./mail.svg"; diff --git a/components/AuthorCard/twitter.svg b/components/AuthorCard/twitter.svg index 7bb4225..5f86d9f 100644 --- a/components/AuthorCard/twitter.svg +++ b/components/AuthorCard/twitter.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/components/AuthorCard/twitter_old.svg b/components/AuthorCard/twitter_old.svg new file mode 100644 index 0000000..7bb4225 --- /dev/null +++ b/components/AuthorCard/twitter_old.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/components/BreakingBanner/index.jsx b/components/BreakingBanner/index.jsx index 8466d1a..efcfb67 100644 --- a/components/BreakingBanner/index.jsx +++ b/components/BreakingBanner/index.jsx @@ -1,5 +1,5 @@ import * as React from "react"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; diff --git a/components/BreakingFeedsHeader/index.jsx b/components/BreakingFeedsHeader/index.jsx new file mode 100644 index 0000000..a89ac80 --- /dev/null +++ b/components/BreakingFeedsHeader/index.jsx @@ -0,0 +1,122 @@ +import * as React from "react"; +import Link from "next/link"; +/** @jsxImportSource @emotion/react */ +import { css, jsx } from "@emotion/core"; +import * as globals from "../globals"; + +export default function BreakingFeedsHeader(props) { + return ( +
+
+
+ {/* Adjust the size as needed */} + + +
+ +
+
+ +
+ +
+
+ ); +} diff --git a/components/ClassifiedsCard/index.jsx b/components/ClassifiedsCard/index.jsx index 6f6b0fa..fd0e3d3 100644 --- a/components/ClassifiedsCard/index.jsx +++ b/components/ClassifiedsCard/index.jsx @@ -1,5 +1,5 @@ import * as React from "react"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; diff --git a/components/CommentFAB/index.jsx b/components/CommentFAB/index.jsx index 69fad8c..9f5b61a 100644 --- a/components/CommentFAB/index.jsx +++ b/components/CommentFAB/index.jsx @@ -1,5 +1,5 @@ import * as React from "react"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; import comment from "./comment.svg"; @@ -32,7 +32,8 @@ export default class CommentFAB extends React.Component { return (
+
+ +
+ + ); +} diff --git a/components/GamesCard/WestWordLogoCropped.png b/components/GamesCard/WestWordLogoCropped.png new file mode 100644 index 0000000..89e1e3b Binary files /dev/null and b/components/GamesCard/WestWordLogoCropped.png differ diff --git a/components/InTheNewsBanner/index.jsx b/components/InTheNewsBanner/index.jsx index e48d7c1..d0ce128 100644 --- a/components/InTheNewsBanner/index.jsx +++ b/components/InTheNewsBanner/index.jsx @@ -1,6 +1,6 @@ import * as React from "react"; import Link from "next/link"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; diff --git a/components/LoadingBear/index.jsx b/components/LoadingBear/index.jsx index 005b2cd..7d049e0 100644 --- a/components/LoadingBear/index.jsx +++ b/components/LoadingBear/index.jsx @@ -1,5 +1,5 @@ import * as React from "react"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; diff --git a/components/MainSiteFooter/index.jsx b/components/MainSiteFooter/index.jsx index 7c88ed3..b325244 100644 --- a/components/MainSiteFooter/index.jsx +++ b/components/MainSiteFooter/index.jsx @@ -1,5 +1,5 @@ import * as React from "react"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as MainSiteStyles from "../globals"; import FooterLink from "../Footer/FooterLink"; @@ -8,14 +8,14 @@ export default function MainSiteFooter(props) { const mainSiteFooterLinks = [ { text: "About", url: "/about" }, { text: "Contact", url: "/contact" }, + { text: "Submit", url: "/submit" }, { text: "Advertise", url: "/advertise" }, { text: "Staff", url: "/staff" }, { text: "Stonewall", url: "/stonewall" }, { text: "Editorial Board", url: "/editorial-board" }, { text: "Privacy", url: "/privacy" }, { text: "Comment Policy", url: "/comment" }, - { text: "Community Guide", url: "/the-daily-bruin-community-guide" }, - { text: "Submit", url: "/submit" } + { text: "Community Guide", url: "/the-daily-bruin-community-guide" } ]; const renderedLinks = mainSiteFooterLinks.map(link => ( @@ -40,6 +40,10 @@ export default function MainSiteFooter(props) { ${MainSiteStyles.phone} { flex-direction: column; } + + ${MainSiteStyles.tablet} { + flex-direction: column; + } `} >
{renderedLinks} @@ -74,6 +91,12 @@ export default function MainSiteFooter(props) { margin: auto; padding-top: 4px; } + + ${MainSiteStyles.tablet} { + text-align: center; + margin: auto; + padding-top: 4px; + } `} > Copyright © {currentYear} Daily Bruin diff --git a/components/MainSiteHeader/HeaderBar.tsx b/components/MainSiteHeader/HeaderBar.tsx index ac3b9e4..3e47911 100644 --- a/components/MainSiteHeader/HeaderBar.tsx +++ b/components/MainSiteHeader/HeaderBar.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from '@emotion/core' const dbLogo=require('./db_logo.svg') diff --git a/components/MainSiteHeader/index.tsx b/components/MainSiteHeader/index.tsx index 48c891f..f2a3818 100644 --- a/components/MainSiteHeader/index.tsx +++ b/components/MainSiteHeader/index.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from '@emotion/core' import * as MainSiteStyles from '../globals' diff --git a/components/Masthead/Desktop.jsx b/components/Masthead/Desktop.jsx index f0718e8..84854c8 100644 --- a/components/Masthead/Desktop.jsx +++ b/components/Masthead/Desktop.jsx @@ -1,5 +1,5 @@ import * as React from "react"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { Global, css, jsx } from "@emotion/core"; import moment from "moment"; import Head from "next/head"; @@ -112,6 +112,7 @@ export default class Desktop extends React.Component { } } return ( + Advertise - + Donate Submit @@ -478,6 +451,7 @@ export default class Desktop extends React.Component {
+ ); } } diff --git a/components/Masthead/Mobile.jsx b/components/Masthead/Mobile.jsx index e093e34..811449c 100644 --- a/components/Masthead/Mobile.jsx +++ b/components/Masthead/Mobile.jsx @@ -1,5 +1,5 @@ import * as React from "react"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { Global, css, jsx } from "@emotion/core"; import Head from "next/head"; @@ -384,7 +384,7 @@ export default class Mobile extends React.Component { Advertise \ No newline at end of file + + + diff --git a/components/Masthead/twitter_old.svg b/components/Masthead/twitter_old.svg new file mode 100644 index 0000000..1970575 --- /dev/null +++ b/components/Masthead/twitter_old.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/components/MultimediaScroller/Media.jsx b/components/MultimediaScroller/Media.jsx index 9edd5c8..8d4f914 100644 --- a/components/MultimediaScroller/Media.jsx +++ b/components/MultimediaScroller/Media.jsx @@ -1,5 +1,5 @@ import * as React from "react"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; diff --git a/components/MultimediaScroller/index.jsx b/components/MultimediaScroller/index.jsx index 1424dec..3ba0a1c 100644 --- a/components/MultimediaScroller/index.jsx +++ b/components/MultimediaScroller/index.jsx @@ -1,5 +1,5 @@ import * as React from "react"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import Media from "./Media"; diff --git a/components/Page/index.jsx b/components/Page/index.jsx index c4b1f74..c620ceb 100644 --- a/components/Page/index.jsx +++ b/components/Page/index.jsx @@ -1,6 +1,6 @@ import * as React from "react"; import Link from "next/link"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; import { date2string } from "./utilities.js"; diff --git a/components/PhotoCard/index.jsx b/components/PhotoCard/index.jsx index 9b3c77a..f4c3ade 100644 --- a/components/PhotoCard/index.jsx +++ b/components/PhotoCard/index.jsx @@ -1,6 +1,6 @@ import * as React from "react"; import Link from "next/link"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; import * as utilities from "./utilities"; diff --git a/components/PhotoGallery/Header.jsx b/components/PhotoGallery/Header.jsx index 46b09bb..e85033e 100644 --- a/components/PhotoGallery/Header.jsx +++ b/components/PhotoGallery/Header.jsx @@ -1,5 +1,5 @@ import * as React from "react"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; import InFocusLogo from "./infocus.png"; diff --git a/components/PhotoGallery/Photo.jsx b/components/PhotoGallery/Photo.jsx index 92e8f58..22735bb 100644 --- a/components/PhotoGallery/Photo.jsx +++ b/components/PhotoGallery/Photo.jsx @@ -1,5 +1,5 @@ import * as React from "react"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; diff --git a/components/PhotoGallery/index.jsx b/components/PhotoGallery/index.jsx index cab23ff..d9852c2 100644 --- a/components/PhotoGallery/index.jsx +++ b/components/PhotoGallery/index.jsx @@ -1,5 +1,5 @@ import * as React from "react"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; diff --git a/components/PhotoGrid/Photo.jsx b/components/PhotoGrid/Photo.jsx index 79c27b1..9aa932b 100644 --- a/components/PhotoGrid/Photo.jsx +++ b/components/PhotoGrid/Photo.jsx @@ -1,6 +1,6 @@ import * as React from "react"; import Link from "next/link"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; diff --git a/components/PhotoGrid/index.jsx b/components/PhotoGrid/index.jsx index 514fc26..f1b06f1 100644 --- a/components/PhotoGrid/index.jsx +++ b/components/PhotoGrid/index.jsx @@ -1,6 +1,6 @@ import * as React from "react"; import Head from "next/head"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; import Masonry from "react-masonry-component"; diff --git a/components/Poll/Choice.jsx b/components/Poll/Choice.jsx index 9e88f21..fc84903 100644 --- a/components/Poll/Choice.jsx +++ b/components/Poll/Choice.jsx @@ -1,7 +1,7 @@ // import { faCheckCircle } from '@fortawesome/free-solid-svg-icons' // import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import * as React from 'react' -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from '@emotion/core' import * as MainSiteStyles from '../globals' diff --git a/components/Poll/Graph.jsx b/components/Poll/Graph.jsx index f86c66f..52505c9 100644 --- a/components/Poll/Graph.jsx +++ b/components/Poll/Graph.jsx @@ -1,5 +1,5 @@ import React from 'react' -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from '@emotion/core' import * as MainSiteStyles from '../globals' import * as d3 from 'd3' diff --git a/components/Poll/Question.jsx b/components/Poll/Question.jsx index 6ea9099..dca728d 100644 --- a/components/Poll/Question.jsx +++ b/components/Poll/Question.jsx @@ -1,5 +1,5 @@ import * as React from 'react' -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from '@emotion/core' import * as MainSiteStyles from '../globals' diff --git a/components/Poll/index.jsx b/components/Poll/index.jsx index b2f2836..44b97d5 100644 --- a/components/Poll/index.jsx +++ b/components/Poll/index.jsx @@ -1,5 +1,5 @@ import * as React from 'react' -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from '@emotion/core' import * as MainSiteStyles from '../globals' import Choice from './Choice' diff --git a/components/ReviewInfobox/index.jsx b/components/ReviewInfobox/index.jsx index 3eb9b0b..1aa0dc0 100644 --- a/components/ReviewInfobox/index.jsx +++ b/components/ReviewInfobox/index.jsx @@ -1,5 +1,5 @@ import * as React from "react"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import fullStar from "./paw-filled.svg"; diff --git a/components/SearchResults/index.jsx b/components/SearchResults/index.jsx index d538b88..3334655 100644 --- a/components/SearchResults/index.jsx +++ b/components/SearchResults/index.jsx @@ -1,5 +1,5 @@ import * as React from "react"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; diff --git a/components/SectionHeader/index.jsx b/components/SectionHeader/index.jsx index 6a12bda..db5a592 100644 --- a/components/SectionHeader/index.jsx +++ b/components/SectionHeader/index.jsx @@ -1,6 +1,6 @@ import * as React from "react"; import Link from "next/link"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; import InFocusLogo from "./infocus.png"; @@ -26,7 +26,11 @@ export default class SectionHeader extends React.Component { `} > ); - } else { + // } else if (this.props.category == "Breaking News") { + + // } + } + else { return (
); @@ -81,6 +85,44 @@ export default class SectionHeader extends React.Component { > {renderTitle()}
+ {this.props.description != undefined && ( + <> +
+ {this.props.description.desktop} +
+
+ {this.props.description.mobile} +
+ + )}
\ No newline at end of file + + + diff --git a/components/ShareButtons/twitter_old.svg b/components/ShareButtons/twitter_old.svg new file mode 100644 index 0000000..57e01fe --- /dev/null +++ b/components/ShareButtons/twitter_old.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/components/SponsoredArticle/Landing.jsx b/components/SponsoredArticle/Landing.jsx index 1c50416..5bcefcd 100644 --- a/components/SponsoredArticle/Landing.jsx +++ b/components/SponsoredArticle/Landing.jsx @@ -1,5 +1,5 @@ import * as React from "react"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import logo from "./dailybruin.svg"; import * as globals from "../globals"; diff --git a/components/SponsoredArticle/Tag.jsx b/components/SponsoredArticle/Tag.jsx index d672c7f..0bad632 100644 --- a/components/SponsoredArticle/Tag.jsx +++ b/components/SponsoredArticle/Tag.jsx @@ -1,5 +1,5 @@ import * as React from "react"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import logo from "./db.png"; // import minilogo from "../../public/favicons/favicon-194x194.png"; diff --git a/components/SponsoredArticle/index.jsx b/components/SponsoredArticle/index.jsx index 33223c3..de16a05 100644 --- a/components/SponsoredArticle/index.jsx +++ b/components/SponsoredArticle/index.jsx @@ -1,6 +1,6 @@ import * as React from "react"; import Link from "next/link"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import moment from "moment"; diff --git a/components/SponsoredLinks/index.jsx b/components/SponsoredLinks/index.jsx index 2723e9d..546ab58 100644 --- a/components/SponsoredLinks/index.jsx +++ b/components/SponsoredLinks/index.jsx @@ -1,6 +1,6 @@ import * as React from "react"; import Link from "next/link"; -/** @jsx jsx */ +/** @jsxImportSource @emotion/react */ import { css, jsx } from "@emotion/core"; import * as globals from "../globals"; @@ -15,7 +15,7 @@ export default class SponsoredLinks extends React.Component { background: #fff; box-shadow: ${globals.cardShadow}; padding: 10px; - width: 202%; + width: 100%; `} >

- - + > {/* Chartbeat */} - + > {/* Broadstreet Ads */} - +
diff --git a/pages/api/healthy.jsx b/pages/api/healthy.jsx new file mode 100644 index 0000000..ae9fb68 --- /dev/null +++ b/pages/api/healthy.jsx @@ -0,0 +1,3 @@ +export default function handler(req, res) { + res.status(200).json({ "status": "ok" }) +} \ No newline at end of file diff --git a/pages/api/hostname.jsx b/pages/api/hostname.jsx new file mode 100644 index 0000000..edd5301 --- /dev/null +++ b/pages/api/hostname.jsx @@ -0,0 +1,6 @@ +var os = require("os"); +var hostname = os.hostname(); + +export default function handler(req, res) { + res.status(200).json({ "hostname": hostname }) +} \ No newline at end of file diff --git a/pages/author/[slug].jsx b/pages/author/[slug].jsx index 87ada7e..a25dbba 100644 --- a/pages/author/[slug].jsx +++ b/pages/author/[slug].jsx @@ -14,7 +14,7 @@ class Author extends Component { ); const author = await authorRes.json(); const postsRes = await fetch( - `${Config.apiUrl}/wp-json/wp/v2/posts?_embed&filter[author_name]=${slug}` + `${Config.apiUrl}/wp-json/wp/v2/posts?_embed&filter[author_name]=${slug}&categories_exclude=27179,27127` // 27179 is the category id of breaking feed posts ); const posts = await postsRes.json(); const classifiedsRes = await fetch( @@ -30,11 +30,7 @@ class Author extends Component { return ( <> - + <title>{this.props.author[0].name + " - Daily Bruin"} sub.slug == "opinion-columns" + ); + const columnSeriesIndex = subcategories.findIndex( + sub => sub.slug == "opinion-column-series" + ); + const temp = subcategories[columnsIndex]; + subcategories[columnsIndex] = subcategories[columnSeriesIndex]; + subcategories[columnSeriesIndex] = temp; + + if (!COLUMN_SERIES_FEATURE_FLAG) { + subcategories.pop(); + } + } + const postsRes = await fetch( `${Config.apiUrl}/wp-json/wp/v2/posts?_embed&categories=${category[0].id}` ); @@ -45,7 +81,8 @@ class Category extends Component { if ( this.props.category == undefined || this.props.category.data != undefined || - this.props.category.length == 0 + this.props.category.length == 0 || + this.slug == 'breaking' ) { return ; } @@ -67,6 +104,7 @@ class Category extends Component {
diff --git a/pages/category/breaking/[slug].jsx b/pages/category/breaking/[slug].jsx new file mode 100644 index 0000000..10674bd --- /dev/null +++ b/pages/category/breaking/[slug].jsx @@ -0,0 +1,71 @@ +import PageWrapper from "../../../layouts/PageWrapper"; +import React, { Component } from "react"; +import Error from "next/error"; +import { Config } from "../../../config.js"; +import Head from "next/head"; + +import BreakingFeedsHeader from "../../../components/BreakingFeedsHeader"; +import BreakingLayout from "../../../layouts/Breaking"; + +/* +When we have a URL that is https://dailybruin.com/category/breaking/[tag name] +First we take the slug that is provided in the url, then we get the ID of that slug +Next we create a new query string +Category ID #27093 is the Category ID of breaking news +https://wp.dailybruin.com/wp-json/wp/v2/posts?categories=27093&tags=[TAG ID] +*/ + +class Tag extends Component { + static async getInitialProps(context) { + const { slug } = context.query; + const tagRes = await fetch( + `${Config.apiUrl}/wp-json/wp/v2/tags?slug=${slug}` + ); + const tag = await tagRes.json(); + if (tag.length > 0) { + const postsRes = await fetch( + `${Config.apiUrl}/wp-json/wp/v2/posts?_embed&categories=27179&tags=${tag[0].id}` + ); //27179 is the id the category of breaking feed posts + const posts = await postsRes.json(); + const eventSummaryRes = await fetch( + `${Config.apiUrl}/wp-json/wp/v2/posts?_embed&categories=27127&tags=${tag[0].id}` + ); //27127 is the id of the category of breaking feed overview + const eventSummaries = await eventSummaryRes.json(); + /* + This is temporary for the event summary, we will have to make a new tag / category for event Summary then pluck that + */ + const eventSummary = eventSummaries[0]; + if (eventSummary) { + eventSummary.excerpt.rendered = eventSummary.content.rendered; // Currently making the post content the excerpt in order to keep old card skeleton + } + return { tag, posts, eventSummary }; + } + return { tag }; + } + render() { + if (this.props.tag.data != undefined || this.props.tag.length == 0) + return ; + return ( + <> + + {this.props.tag[0].name + " - Daily Bruin"} + +
+
+ +
+ +
+ + ); + } +} + +export default PageWrapper(Tag); diff --git a/pages/category/breaking/index.jsx b/pages/category/breaking/index.jsx new file mode 100644 index 0000000..c5d0e33 --- /dev/null +++ b/pages/category/breaking/index.jsx @@ -0,0 +1,46 @@ +import PageWrapper from "../../../layouts/PageWrapper"; +import React, { Component } from "react"; +import Error from "next/error"; +import { Config } from "../../../config.js"; +import Head from "next/head"; + +import SectionHeader from "../../../components/SectionHeader"; +import CategoryLayout from "../../../layouts/Category"; + +/* +When we have a URL that is https://dailybruin.com/category/breaking/[tag name] +First we take the slug that is provided in the url, then we get the ID of that slug +Next we create a new query string +Category ID #27093 is the Category ID of breaking news +https://wp.dailybruin.com/wp-json/wp/v2/posts?categories=27093&tags=[TAG ID] +*/ + +class Tag extends Component { + static async getInitialProps(context) { + const postsRes = await fetch( + `${Config.apiUrl}/wp-json/wp/v2/posts?_embed&categories=27093` + ); + const posts = await postsRes.json(); + return { posts }; + } + render() { + return ( + <> + + {"Breaking News - Daily Bruin"} + +
+ +
+ + + ); + } +} + +export default PageWrapper(Tag); diff --git a/pages/category/games.jsx b/pages/category/games.jsx new file mode 100644 index 0000000..bd5c193 --- /dev/null +++ b/pages/category/games.jsx @@ -0,0 +1,61 @@ +import PageWrapper from "../../layouts/PageWrapper"; +import React, { Component } from "react"; +import Error from "next/error"; +import { Config } from "../../config.js"; +import Head from "next/head"; +import SectionHeader from "../../components/SectionHeader"; + +// function resizeIFrameToFitContent(iFrame) { + +// iFrame.width = iFrame.contentWindow.document.body.scrollWidth; +// iFrame.height = iFrame.contentWindow.document.body.scrollHeight; +// } + +// window.addEventListener('DOMContentLoaded', function (e) { + + // var iframes = document.querySelectorAll("iframe"); + // for (var i = 0; i < iframes.length; i++) { + // resizeIFrameToFitContent(iframes[i]); + // } +// }); + + + +class Games extends Component { + static async getInitialProps(context) { + + } + + ComponentDidMount() { + var iFrame = document.getElementById('iFrame1'); + iFrame.width = iFrame.contentWindow.document.body.scrollWidth; + iFrame.height = iFrame.contentWindow.document.body.scrollHeight; + } + + render() { + return ( + <> + + {"Games - Daily Bruin"} + +
+ +
+