diff --git a/README.md b/README.md index 94e51d3a..c79d8caf 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,7 @@ There are two ways to authenticate a user in Stash-box: a session or an API key. | `activation_expiry` | `7200` (2 hours) | The time - in seconds - after which an activation key (emailed to the user for email verification or password reset purposes) expires. | | `email_cooldown` | `300` (5 minutes) | The time - in seconds - that a user must wait before submitting an activation or reset password request for a specific email address. | | `default_user_roles` | `READ`, `VOTE`, `EDIT` | The roles assigned to new users when registering. This field must be expressed as a yaml array. | +| `guidelines_url` | (none) | URL to link to a set of guidelines for users contributing edits. Should be in the form of `https://hostname.com`. | | `vote_promotion_threshold` | (none) | Number of approved edits before a user automatically has the `VOTE` role assigned. Leave empty to disable. | | `vote_application_threshold` | `3` | Number of same votes required for immediate application of an edit. Set to zero to disable automatic application. | | `voting_period` | `345600` | Time, in seconds, before a voting period is closed. | diff --git a/frontend/src/Main.tsx b/frontend/src/Main.tsx index 6b49ab92..2287ea32 100644 --- a/frontend/src/Main.tsx +++ b/frontend/src/Main.tsx @@ -3,9 +3,12 @@ import { Navbar, Nav } from "react-bootstrap"; import { NavLink, useLocation, useNavigate } from "react-router-dom"; import SearchField, { SearchType } from "src/components/searchField"; +import { useConfig } from "src/graphql"; import { getPlatformURL, getCredentialsSetting } from "src/utils/createClient"; import { isAdmin, canEdit, userHref, setCachedUser } from "src/utils"; import { useAuth } from "src/hooks"; +import { Icon } from "src/components/fragments"; +import { faBook, faUser } from "@fortawesome/free-solid-svg-icons"; import { ROUTE_SCENES, ROUTE_PERFORMERS, @@ -33,6 +36,9 @@ const Main: FC = ({ children }) => { const location = useLocation(); const navigate = useNavigate(); const { loading, user } = useAuth(); + const { data: configData } = useConfig(); + + const guidelinesURL = configData?.getConfig.guidelines_url; useEffect(() => { if (loading || user) return; @@ -73,11 +79,11 @@ const Main: FC = ({ children }) => { contextValue.authenticated && contextValue.user && ( <> - Logged in as + {contextValue.user.name} {isAdmin(user) && ( @@ -127,6 +133,17 @@ const Main: FC = ({ children }) => { Sites )} + {guidelinesURL && ( + + + Guidelines + + )}