mirror of
https://github.com/modrinth/code.git
synced 2026-08-24 16:44:51 +00:00
* fix authorized apps settings, redesign, fix retro theme vars * merge * fix: retro in app --------- Co-authored-by: Calum H. (IMB11) <contact@cal.engineer>
30 lines
735 B
TypeScript
30 lines
735 B
TypeScript
// noinspection JSUnusedGlobalSymbols
|
|
|
|
export const getUserLink = (user) => {
|
|
return `/user/${user.username}`
|
|
}
|
|
|
|
export const isStaff = (user) => {
|
|
return user && STAFF_ROLES.includes(user.role)
|
|
}
|
|
|
|
export const isAdmin = (user) => {
|
|
return user && user.role === 'admin'
|
|
}
|
|
|
|
export const STAFF_ROLES = ['moderator', 'admin']
|
|
|
|
export const MODRINTH_USER_ID = '2REoufqX'
|
|
export const AUTOMOD_USER_ID = ''
|
|
export const MODRINTH_ARCHIVES_USER_ID = 'GVFjtWTf'
|
|
|
|
export const OFFICIAL_ACCOUNT_IDS = [MODRINTH_USER_ID, AUTOMOD_USER_ID, MODRINTH_ARCHIVES_USER_ID]
|
|
|
|
export const isModrinthUser = (userId) => {
|
|
return userId === MODRINTH_USER_ID
|
|
}
|
|
|
|
export const isOfficialAccount = (userId) => {
|
|
return OFFICIAL_ACCOUNT_IDS.includes(userId)
|
|
}
|