Skip to content

Commit

Permalink
socials fix #96
Browse files Browse the repository at this point in the history
  • Loading branch information
djobbo committed Jan 31, 2024
1 parent a2d5ad1 commit e9f1654
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 30 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ coverage

# next.js
.next/
.vercel/
out/
build

Expand Down
11 changes: 8 additions & 3 deletions app/app/[locale]/_landing/DiscordCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { ArrowSmRightIcon, DiscordIcon, KofiIcon } from "ui/icons"
import { Button } from "ui/base/Button"
import { COREHALLA_DISCORD_URL, COREHALLA_KOFI_URL } from "@/socials"
import { Image } from "@/components/Image"
import { Trans } from "@lingui/macro"
import { clamp } from "common/helpers/math"
Expand Down Expand Up @@ -90,7 +91,7 @@ export const DiscordCard = () => {
</Trans>
</p>
<a
href="/discord"
href={COREHALLA_DISCORD_URL}
target="_blank"
aria-label="Join our Discord server to share your thoughts"
>
Expand All @@ -101,13 +102,17 @@ export const DiscordCard = () => {
</a>
</div>
<div className="flex gap-2 justify-end p-4">
<Button as="a" href="/discord" target="_blank">
<Button
as="a"
href={COREHALLA_DISCORD_URL}
target="_blank"
>
<DiscordIcon size="16" className="mr-2" />{" "}
<Trans>Join</Trans>
</Button>
<Button
as="a"
href="/donate"
href={COREHALLA_KOFI_URL}
target="_blank"
className="bg-accentAlt"
>
Expand Down
13 changes: 11 additions & 2 deletions app/app/[locale]/_layout/ErrorDisplay.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Button } from "ui/base/Button"
import { COREHALLA_DISCORD_URL, COREHALLA_GITHUB_URL } from "@/socials"
import { DiscordIcon, GithubIcon } from "ui/icons"
import { SectionTitle } from "@/components/layout/SectionTitle"
import { Trans } from "@lingui/macro"
Expand Down Expand Up @@ -35,7 +36,11 @@ export const ErrorDisplay = ({
buttonStyle="outline"
onClick={() => {
window
?.open("/discord", "_blank", "noreferrer")
?.open(
COREHALLA_DISCORD_URL,
"_blank",
"noreferrer",
)
?.focus()
}}
className="flex items-center gap-2"
Expand All @@ -46,7 +51,11 @@ export const ErrorDisplay = ({
buttonStyle="outline"
onClick={() => {
window
?.open("/github", "_blank", "noreferrer")
?.open(
COREHALLA_GITHUB_URL,
"_blank",
"noreferrer",
)
?.focus()
}}
className="flex items-center gap-2"
Expand Down
11 changes: 8 additions & 3 deletions app/app/[locale]/_layout/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
import {
COREHALLA_DISCORD_URL,
COREHALLA_GITHUB_URL,
COREHALLA_TWITTER_URL,
} from "@/socials"
import { DiscordIcon, GithubIcon, TwitterIcon } from "ui/icons"
import { Tooltip } from "ui/base/Tooltip"
import { Trans } from "@lingui/macro"
import Link from "next/link"

const socialLinks = [
{
href: "/discord",
href: COREHALLA_DISCORD_URL,
Icon: DiscordIcon,
name: "Discord",
},
{
href: "/twitter",
href: COREHALLA_TWITTER_URL,
Icon: TwitterIcon,
name: "Twitter",
},
{
href: "/github",
href: COREHALLA_GITHUB_URL,
Icon: GithubIcon,
name: "Github",
},
Expand Down
11 changes: 8 additions & 3 deletions app/app/[locale]/_layout/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

import { AlertBar } from "./AlertBar"
import { Button } from "ui/base/Button"
import {
COREHALLA_DISCORD_URL,
COREHALLA_GITHUB_URL,
COREHALLA_TWITTER_URL,
} from "@/socials"
import { DiscordIcon, GithubIcon, TwitterIcon } from "ui/icons"
import { HamburgerMenuIcon } from "ui/icons"
import { Image } from "@/components/Image"
Expand Down Expand Up @@ -97,21 +102,21 @@ export const Header = ({ className }: HeaderProps) => {
<div className="hidden md:flex items-center gap-1 ml-2">
<Link
className="text-textVar1 hover:text-text"
href="/discord"
href={COREHALLA_DISCORD_URL}
target="_blank"
>
<DiscordIcon size="16" className="mr-2" />
</Link>
<Link
className="text-textVar1 hover:text-text"
href="/twitter"
href={COREHALLA_TWITTER_URL}
target="_blank"
>
<TwitterIcon size="16" className="mr-2" />
</Link>
<Link
className="text-textVar1 hover:text-text"
href="/github"
href={COREHALLA_GITHUB_URL}
target="_blank"
>
<GithubIcon size="16" className="mr-2" />
Expand Down
5 changes: 3 additions & 2 deletions app/app/[locale]/_layout/SideNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from "ui/icons"
import { HiBookOpen, HiHeart, HiHome, HiUserGroup, HiX } from "react-icons/hi"
// TODO: replace react-icons with lucide
import { BRAWLHALLA_WIKI_URL, COREHALLA_DISCORD_URL } from "@/socials"
import { Image } from "@/components/Image"
import { type MessageDescriptor } from "@lingui/core"
import { Tooltip } from "ui/base/Tooltip"
Expand Down Expand Up @@ -162,14 +163,14 @@ export const SideNav = ({ className }: SideNavProps) => {
{
id: "discord",
name: msg`Discord Server`,
href: "/discord",
href: COREHALLA_DISCORD_URL,
icon: <DiscordIcon className="w-6 h-6" />,
external: true,
},
{
id: "wiki",
name: msg`Wiki`,
href: "/wiki",
href: BRAWLHALLA_WIKI_URL,
icon: <HiBookOpen className="w-6 h-6" />,
external: true,
},
Expand Down
5 changes: 3 additions & 2 deletions app/app/[locale]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ArrowSmRightIcon } from "ui/icons"
import { ArticlePreviewGrid } from "@/components/articles/ArticlePreviewGrid"
import { Button } from "ui/base/Button"
import { COREHALLA_DISCORD_URL } from "@/socials"
import { DiscordCard } from "./_landing/DiscordCard"
import { LandingFavorites } from "./_landing/LandingFavorites"
import { SearchButton } from "@/components/search/SearchButton"
Expand Down Expand Up @@ -29,7 +30,7 @@ export default async function Home() {
)}
>
<Link
href="/discord"
href={COREHALLA_DISCORD_URL}
target="_blank"
className="flex items-center gap-2 pl-3 pr-2 py-1 bg-bgVar1/75 rounded-full border border-bg text-sm hover:bg-bgVar2"
aria-label='Join our "Corehalla" Discord server'
Expand Down Expand Up @@ -89,7 +90,7 @@ export default async function Home() {
<div>
<DiscordCard />
<Link
href="/discord"
href={COREHALLA_DISCORD_URL}
target="_blank"
aria-label="Discord server link"
className="block text-sm mt-2 text-textVar1 text-center"
Expand Down
11 changes: 8 additions & 3 deletions app/components/FirstTimePopup.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
"use client"

import { Button } from "ui/base/Button"
import {
COREHALLA_DISCORD_URL,
COREHALLA_GITHUB_URL,
COREHALLA_TWITTER_URL,
} from "@/socials"
import { CloseIcon, DiscordIcon, GithubIcon, TwitterIcon } from "ui/icons"
import { useLocalStorageState } from "common/hooks/useLocalStorageState"
import Link from "next/link"
Expand All @@ -24,21 +29,21 @@ export const FirstTimePopup = () => {
<span className="text-sm text-textVar1">Join us:</span>
<Link
className="text-textVar1 hover:text-text"
href="/discord"
href={COREHALLA_DISCORD_URL}
target="_blank"
>
<DiscordIcon size="24" />
</Link>
<Link
className="text-textVar1 hover:text-text"
href="/twitter"
href={COREHALLA_TWITTER_URL}
target="_blank"
>
<TwitterIcon size="24" />
</Link>
<Link
className="text-textVar1 hover:text-text"
href="/github"
href={COREHALLA_GITHUB_URL}
target="_blank"
>
<GithubIcon size="24" />
Expand Down
20 changes: 12 additions & 8 deletions app/next.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
const BRAWLHALLA_WIKI_URL = "https://brawlhalla.fandom.com/wiki/Brawlhalla_Wiki"
const COREHALLA_DISCORD_URL = "https://discord.com/invite/eD248ez"
const COREHALLA_GITHUB_URL = "https://github.com/djobbo/corehalla"
const COREHALLA_TWITTER_URL = "https://twitter.com/Corehalla"
const COREHALLA_KOFI_URL = "https://ko-fi.com/corehalla"
const {
BRAWLHALLA_WIKI_URL,
COREHALLA_DISCORD_URL,
COREHALLA_GITHUB_URL,
COREHALLA_TWITTER_URL,
COREHALLA_KOFI_URL,
// eslint-disable-next-line @typescript-eslint/no-var-requires
} = require("./socials")

// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require("path")
Expand Down Expand Up @@ -57,11 +60,12 @@ const nextConfig = {
},
],
},
experimental: {
logging: {
level: "verbose",
logging: {
fetches: {
fullUrl: true,
},
},
experimental: {
swcPlugins: [
[
"@lingui/swc-plugin",
Expand Down
7 changes: 7 additions & 0 deletions app/socials.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
BRAWLHALLA_WIKI_URL: "https://brawlhalla.fandom.com/wiki/Brawlhalla_Wiki",
COREHALLA_DISCORD_URL: "https://discord.com/invite/eD248ez",
COREHALLA_GITHUB_URL: "https://github.com/djobbo/corehalla",
COREHALLA_TWITTER_URL: "https://twitter.com/Corehalla",
COREHALLA_KOFI_URL: "https://ko-fi.com/corehalla",
}
9 changes: 5 additions & 4 deletions app/util/alerts.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { COREHALLA_DISCORD_URL } from "@/socials"
import Link from "next/link"

export const alerts = {
BH_MAINTENANCE: (
<span>
Brawlhalla maintenance ongoing. More info{" "}
<Link
href="/discord"
href={COREHALLA_DISCORD_URL}
target="_blank"
className="text-accentAlt font-semibold hover:text-text"
>
Expand All @@ -19,7 +20,7 @@ export const alerts = {
Known issues with fetching stats from Brawlhalla{"'"}s servers, don
{"'"}t panic. Updates{" "}
<Link
href="/discord"
href={COREHALLA_DISCORD_URL}
target="_blank"
className="text-accentAlt font-semibold hover:text-text"
>
Expand All @@ -33,7 +34,7 @@ export const alerts = {
Authentication server is down, and so favorites aren{"'"}t
accessible, sorry for the inconvenience. Updates{" "}
<Link
href="/discord"
href={COREHALLA_DISCORD_URL}
target="_blank"
className="text-accentAlt font-semibold hover:text-text"
>
Expand All @@ -47,7 +48,7 @@ export const alerts = {
Authentication server is back online, you can reconnect! Don{"'"}t
forget to join our{" "}
<Link
href="/discord"
href={COREHALLA_DISCORD_URL}
target="_blank"
className="text-accentAlt font-semibold hover:text-text"
>
Expand Down

0 comments on commit e9f1654

Please sign in to comment.