mirror of
https://github.com/wavetermdev/docusaurus-og.git
synced 2026-08-05 13:46:35 -07:00
use all the data in team.json file as it's automatically generated by the preset.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
"prepublishOnly": "yarn build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@acid-info/logos-docusaurus-preset": "^0.1.2",
|
||||
"@docusaurus/core": "2.1.0",
|
||||
"@docusaurus/mdx-loader": "2.1.0",
|
||||
"@docusaurus/module-type-aliases": "2.1.0",
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
import React from 'react'
|
||||
import clsx from 'clsx'
|
||||
import styles from './style.module.scss'
|
||||
import { useTeam } from '@logos-theme/lib/team.utils'
|
||||
import { ELogosTeamNames } from '@logos-theme/types/team'
|
||||
import { SocialMediaItem } from '../../Icon/SocialmediaLink'
|
||||
import { ECommunityProviders } from '@logos-theme/types/ui.types'
|
||||
import {
|
||||
globalStore,
|
||||
selectHiddenSidebar,
|
||||
} from '@logos-theme/containers/GlobalStore/index'
|
||||
import { useTeam } from '@logos-theme/lib/team.utils'
|
||||
import { ECommunityProviders } from '@logos-theme/types/ui.types'
|
||||
import clsx from 'clsx'
|
||||
import React from 'react'
|
||||
import { SocialMediaItem } from '../../Icon/SocialmediaLink'
|
||||
import styles from './style.module.scss'
|
||||
|
||||
type TProps = {
|
||||
children: React.ReactNode
|
||||
}
|
||||
|
||||
export const TeamList = (props: TProps): JSX.Element => {
|
||||
const team = useTeam('codex' as ELogosTeamNames)
|
||||
const team = useTeam()
|
||||
const hiddenSidebar = globalStore.useSelector(selectHiddenSidebar)
|
||||
|
||||
return (
|
||||
@@ -30,9 +29,9 @@ export const TeamList = (props: TProps): JSX.Element => {
|
||||
<div className={clsx('', styles.memberCard)} key={`mc-${index}`}>
|
||||
<div className={clsx('', styles.memberCardImage)}>
|
||||
<img
|
||||
src={member['photo-path']}
|
||||
src={member['photo-path'] ?? ''}
|
||||
alt={member['pref-name']}
|
||||
title={member.contact.email}
|
||||
title={member.contact.email ?? ''}
|
||||
/>
|
||||
</div>
|
||||
<div className={clsx('card', styles.memberCardCaption)}>
|
||||
|
||||
@@ -1,25 +1,20 @@
|
||||
import { Status } from '@acid-info/logos-docusaurus-preset'
|
||||
import useBaseUrl from '@docusaurus/useBaseUrl'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { ELogosTeamNames, IStatusTeamMember } from '../types/team'
|
||||
|
||||
interface IStatusTeamMembersApiResponse {
|
||||
[key: string]: IStatusTeamMember
|
||||
}
|
||||
|
||||
export const useTeam = (team: ELogosTeamNames) => {
|
||||
const [contributors, setContributors] = useState<IStatusTeamMember[]>([])
|
||||
export const useTeam = () => {
|
||||
const [contributors, setContributors] = useState<Status.Contacts.Contact[]>(
|
||||
[],
|
||||
)
|
||||
const url = useBaseUrl(`/data/team.json`)
|
||||
|
||||
useEffect(() => {
|
||||
fetch(url)
|
||||
.then((response) => response.json())
|
||||
.then((data: IStatusTeamMembersApiResponse) => {
|
||||
setContributors(
|
||||
Object.values(data).filter(
|
||||
(d) => d.department && d.department.toLocaleLowerCase() === team,
|
||||
),
|
||||
)
|
||||
.then((data) => {
|
||||
setContributors(data)
|
||||
})
|
||||
}, [])
|
||||
|
||||
return contributors
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
export interface IStatusContact {
|
||||
email: string
|
||||
status?: any
|
||||
github?: any
|
||||
gscholar?: string
|
||||
discord: string
|
||||
}
|
||||
|
||||
export interface IStatusTeamMember {
|
||||
'pref-name': string
|
||||
department: string
|
||||
'photo-path': string
|
||||
contact: IStatusContact
|
||||
}
|
||||
|
||||
export enum ELogosTeamNames {
|
||||
CODEX = 'codex',
|
||||
WAKU = 'waku',
|
||||
VAC = 'vac',
|
||||
}
|
||||
Reference in New Issue
Block a user