-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* update dataset text * update carousel * updates * component * update active state * update link issue * scroll issue to carousel * Add SCP police * update header text * update scroll issue from cards * Add SCP police * Remove SCP police * remove unused files * remove unused import --------- Co-authored-by: ekachxaidze98 <[email protected]>
- Loading branch information
1 parent
c9fb298
commit 0c1fee1
Showing
14 changed files
with
932 additions
and
915 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React, { useState } from 'react' | ||
|
||
import DocumentationPageTemplate from '../../templates/membership-documentation' | ||
|
||
import retrieveContent from 'content' | ||
|
||
const ASSETS_BASE_URL = 'https://oacore.github.io/content/' | ||
|
||
const DocumentationPage = ({ ...props }) => { | ||
const [stateData, setStateData] = useState({}) | ||
|
||
const setAssetsUrl = (object) => { | ||
Object.entries(object).forEach(([, value]) => { | ||
delete value.membership | ||
if (value.images) { | ||
Object.entries(value.images).forEach(([, item]) => { | ||
item.file = ASSETS_BASE_URL + item.file | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
const getSections = async ({ ref } = {}) => { | ||
const content = await retrieveContent('docs-membership', { | ||
ref, | ||
transform: 'object', | ||
}) | ||
|
||
delete content.headerDashboard | ||
Object.values(content).forEach((section) => { | ||
if (section.items) setAssetsUrl(section.items) | ||
}) | ||
|
||
return content | ||
} | ||
if (Object.getOwnPropertyNames(stateData).length === 0) { | ||
getSections().then((val) => { | ||
setStateData(val) | ||
}) | ||
return <></> | ||
} | ||
return <DocumentationPageTemplate {...props} {...stateData} /> | ||
} | ||
|
||
export default DocumentationPage |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import React, { useEffect, useState } from 'react' | ||
import { | ||
DocumentationMembership, | ||
DocumentationMembershipNav, | ||
} from '@oacore/design/lib/modules' | ||
import { useRouter } from 'next/router' | ||
|
||
import Markdown from '../../components/markdown' | ||
import { Layout } from '../../design-v2/components' | ||
import textData from '../../data/membership.yml' | ||
|
||
function normalizeHref(str) { | ||
const test = str.replace('#', '') | ||
return test.replace('_', '-') | ||
} | ||
|
||
const DocumentationPageTemplate = ({ headerAbout, docs }) => { | ||
const [highlight, setHighlight] = useState() | ||
const [navActiveIndex, setNavActiveIndex] = useState(null) | ||
const route = useRouter() | ||
useEffect(() => { | ||
const id = route.query?.r | ||
if (id) { | ||
setTimeout(() => { | ||
document.getElementById(id).scrollIntoView({ | ||
behavior: 'smooth', | ||
block: 'center', | ||
}) | ||
const n = docs.items.findIndex((item) => item.id === id) | ||
setHighlight(n) | ||
}, 100) | ||
} | ||
}, [route.query.r]) | ||
|
||
useEffect(() => { | ||
const id = route.query?.r | ||
if (id) { | ||
const n = textData.navItems.findIndex( | ||
(item) => normalizeHref(item.href) === id | ||
) | ||
setNavActiveIndex(n) | ||
} | ||
}, []) | ||
return ( | ||
<Layout> | ||
<DocumentationMembership | ||
headerTitle={headerAbout.header.title} | ||
headerCaption={<Markdown>{headerAbout.header.caption}</Markdown>} | ||
docs={docs} | ||
highlight={highlight} | ||
setHighlight={setHighlight} | ||
nav={ | ||
<DocumentationMembershipNav | ||
activeIndex={navActiveIndex} | ||
setNavActiveIndex={setNavActiveIndex} | ||
textData={textData} | ||
setHighlight={setHighlight} | ||
/> | ||
} | ||
/> | ||
</Layout> | ||
) | ||
} | ||
|
||
export default DocumentationPageTemplate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
.documentation-wrapper { | ||
margin: 15px 0; | ||
} | ||
|
||
.documentation-inner-wrapper { | ||
width: calc(100vw - 370px); | ||
overflow-y: scroll; | ||
} | ||
|
||
.documentation-header { | ||
font-size: 24px; | ||
font-style: normal; | ||
font-weight: 500; | ||
line-height: 24px; | ||
color: #212121; | ||
} | ||
|
||
.documentation-sub-title { | ||
font-size: 16px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 24px; | ||
color: #212121; | ||
} | ||
|
||
.placement { | ||
display: flex; | ||
justify-content: space-between; | ||
max-height: 1472px; | ||
overflow-y: scroll; | ||
padding-top: 24px; | ||
border-top: 2px solid #b75400; | ||
} | ||
|
||
.documentation-item { | ||
padding: 8px 0; | ||
border-bottom: 2px dashed #eee; | ||
p { | ||
margin-top: 24px; | ||
} | ||
} | ||
|
||
.documentation-item ul { | ||
margin-left: 1.5rem; | ||
} | ||
|
||
.documentation-item li { | ||
line-height: 2rem; | ||
list-style-type: disc; | ||
} | ||
|
||
.documentation-item-title { | ||
margin-bottom: 10px; | ||
font-size: 18px; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: 24px; | ||
color: #212121; | ||
} | ||
|
||
.documentation-text { | ||
font-size: 16px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 24px; | ||
color: #212121; | ||
} | ||
|
||
.membership { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: max-content; | ||
height: 24px; | ||
padding: 8px; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 400; | ||
text-transform: capitalize; | ||
border-radius: 2px; | ||
} | ||
|
||
.image { | ||
width: 100%; | ||
margin-bottom: 24px; | ||
object-fit: contain; | ||
} | ||
|
||
.logo-banner { | ||
width: 50%; | ||
} | ||
|
||
.logo-personalised { | ||
width: 50%; | ||
} | ||
|
||
.type-wrapper { | ||
display: flex; | ||
align-items: center; | ||
gap: 4px; | ||
} | ||
|
||
.enabled { | ||
color: #212121; | ||
background: #fae2d2; | ||
} | ||
|
||
.disabled { | ||
color: #bdbdbd; | ||
background: #f5f5f5; | ||
} | ||
|
||
.highlighted { | ||
color: #b75400; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.