mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-07 07:56:12 +02:00
feat: link to the forum
This commit is contained in:
@@ -14,6 +14,15 @@ interface IMenuItemProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const MenuItem: FC<IMenuItemProps> = ({ children, to }) => {
|
const MenuItem: FC<IMenuItemProps> = ({ children, to }) => {
|
||||||
|
if (to.match(/^(https?:\/\/)/)) {
|
||||||
|
return (
|
||||||
|
<SC.MenuItemExternal href={to} target="_blank">
|
||||||
|
<SC.MenuItemText>{children}</SC.MenuItemText>
|
||||||
|
<SC.MenuItemLine />
|
||||||
|
</SC.MenuItemExternal>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SC.MenuItem
|
<SC.MenuItem
|
||||||
to={to}
|
to={to}
|
||||||
@@ -85,6 +94,9 @@ export const HomeHeader: FC<IHomeHeaderProps> = ({ isHome }) => {
|
|||||||
<MenuItem to="/rules">rules</MenuItem>
|
<MenuItem to="/rules">rules</MenuItem>
|
||||||
<MenuItem to="/resources">resources</MenuItem>
|
<MenuItem to="/resources">resources</MenuItem>
|
||||||
<MenuItem to="/archives">tech spotlights</MenuItem>
|
<MenuItem to="/archives">tech spotlights</MenuItem>
|
||||||
|
<MenuItem to="https://forum.theprogrammershangout.com">
|
||||||
|
forum
|
||||||
|
</MenuItem>
|
||||||
</SC.Menu>
|
</SC.Menu>
|
||||||
<DiscordButton>join us</DiscordButton>
|
<DiscordButton>join us</DiscordButton>
|
||||||
{isHome && <HomePartner />}
|
{isHome && <HomePartner />}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Link } from "gatsby"
|
import { Link } from "gatsby"
|
||||||
import Particles from "react-particles-js"
|
import Particles from "react-particles-js"
|
||||||
import styled from "styled-components"
|
import styled, { css } from "styled-components"
|
||||||
import TPHLogo from "../../images/tph-logo.svg"
|
import TPHLogo from "../../images/tph-logo.svg"
|
||||||
|
|
||||||
export const HomeHeaderWrapper = styled.header`
|
export const HomeHeaderWrapper = styled.header`
|
||||||
@@ -144,7 +144,7 @@ export const MenuItemLine = styled.div`
|
|||||||
transition: all 0.3s;
|
transition: all 0.3s;
|
||||||
`
|
`
|
||||||
|
|
||||||
export const MenuItem = styled(Link)`
|
export const menuItemStyles = css`
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
@@ -198,3 +198,11 @@ export const MenuItem = styled(Link)`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
export const MenuItem = styled(Link)`
|
||||||
|
${menuItemStyles};
|
||||||
|
`
|
||||||
|
|
||||||
|
export const MenuItemExternal = styled.a`
|
||||||
|
${menuItemStyles};
|
||||||
|
`
|
||||||
|
|||||||
@@ -11,6 +11,14 @@ interface IMenuItemProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const MenuItem: FC<IMenuItemProps> = ({ children, to }) => {
|
const MenuItem: FC<IMenuItemProps> = ({ children, to }) => {
|
||||||
|
if (to.match(/^(https?:\/\/)/)) {
|
||||||
|
return (
|
||||||
|
<SC.MenuItemExternal href={to} target="_blank">
|
||||||
|
{children}
|
||||||
|
</SC.MenuItemExternal>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SC.MenuItem to={to} activeClassName="active">
|
<SC.MenuItem to={to} activeClassName="active">
|
||||||
{children}
|
{children}
|
||||||
@@ -37,6 +45,9 @@ export const Sidebar: FC<PropsWithChildren<
|
|||||||
<MenuItem to="/rules">rules</MenuItem>
|
<MenuItem to="/rules">rules</MenuItem>
|
||||||
<MenuItem to="/resources">resources</MenuItem>
|
<MenuItem to="/resources">resources</MenuItem>
|
||||||
<MenuItem to="/archives">tech spotlights</MenuItem>
|
<MenuItem to="/archives">tech spotlights</MenuItem>
|
||||||
|
<MenuItem to="https://forum.theprogrammershangout.com">
|
||||||
|
forum
|
||||||
|
</MenuItem>
|
||||||
</SC.Menu>
|
</SC.Menu>
|
||||||
|
|
||||||
<ThemeToggler />
|
<ThemeToggler />
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Link } from "gatsby"
|
import { Link } from "gatsby"
|
||||||
import styled from "styled-components"
|
import styled, { css } from "styled-components"
|
||||||
|
|
||||||
export const SidebarWrapper = styled.div`
|
export const SidebarWrapper = styled.div`
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@@ -39,7 +39,7 @@ export const Menu = styled.nav`
|
|||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
`
|
`
|
||||||
|
|
||||||
export const MenuItem = styled(Link)`
|
export const menuItemStyles = css`
|
||||||
padding: 4px 0;
|
padding: 4px 0;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
color: ${props => props.theme.sidebar.foreground};
|
color: ${props => props.theme.sidebar.foreground};
|
||||||
@@ -54,3 +54,11 @@ export const MenuItem = styled(Link)`
|
|||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
export const MenuItem = styled(Link)`
|
||||||
|
${menuItemStyles};
|
||||||
|
`
|
||||||
|
|
||||||
|
export const MenuItemExternal = styled.a`
|
||||||
|
${menuItemStyles};
|
||||||
|
`
|
||||||
|
|||||||
Reference in New Issue
Block a user