-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(view): 12142 add tos and privacy policy to dn (#279)
* feat: add ability to make route always visible * feat: add PrivacyPolicy page * polishing text and style * feat: add cookies page * feat: add cookies page * fix typo in policy doc * fix typo in styles * feat: Added common page layout * increase test coverage * fix: move nested routes closer to parent * batter naming for new option * cookies file update * migrate sidebar to new interface * remove md files * removed unnecessary style * remove mdx support
- Loading branch information
Showing
22 changed files
with
2,193 additions
and
228 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
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,60 @@ | ||
.mainWrap { | ||
place-content: center; | ||
flex: 1; | ||
padding-top: 80px; | ||
padding-bottom: 80px; | ||
overflow-y: auto; | ||
} | ||
|
||
.content { | ||
max-width: 800px; | ||
margin-left: auto; | ||
margin-right: auto; | ||
font-size: 16px; | ||
line-height: 24px; | ||
box-sizing: content-box; | ||
padding-left: 14px; | ||
padding-right: 14px; | ||
} | ||
|
||
.mainWrap blockquote { | ||
margin-block-start: 2em; | ||
margin-block-end: 2em; | ||
} | ||
|
||
.mainWrap blockquote h3 { | ||
margin-block-end: 0em; | ||
} | ||
|
||
.mainWrap blockquote p { | ||
margin-block-start: 0.3em; | ||
padding-left: 1em; | ||
} | ||
|
||
.mainWrap h1 { | ||
font-weight: 500; | ||
font-size: 48px; | ||
line-height: 62px; | ||
display: flex; | ||
margin: 0 0 40px 0; | ||
} | ||
|
||
.mainWrap a { | ||
color: var(--accent-strong); | ||
text-decoration: none; | ||
cursor: pointer; | ||
} | ||
|
||
.content table { | ||
border-collapse: collapse; | ||
} | ||
|
||
.content td, | ||
.content th { | ||
padding: var(--unit); | ||
border: 1px solid var(--faint-weak); | ||
} | ||
|
||
.content tr:nth-child(odd) { | ||
background-color: var(--base-weak-up); | ||
} |
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,10 @@ | ||
import s from './Article.module.css'; | ||
import type { PropsWithChildren } from 'react'; | ||
|
||
export function Article({ children }: PropsWithChildren) { | ||
return ( | ||
<div className={s.mainWrap}> | ||
<article className={s.content}>{children}</article> | ||
</div> | ||
); | ||
} |
This file was deleted.
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,5 @@ | ||
import { Column } from './Column/Column'; | ||
import { Row } from './Row/Row'; | ||
import { Article } from './Article/Article'; | ||
|
||
export { Row, Column, Article }; |
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
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
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
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
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
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
89 changes: 89 additions & 0 deletions
89
src/features/side_bar/components/SideBar/routeVisibilityChecker.test.ts
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,89 @@ | ||
import React from 'react'; | ||
import { test, expect, beforeEach, describe } from 'vitest'; | ||
import { routeVisibilityChecker } from './routeVisibilityChecker'; | ||
import type { AppRoute } from '~core/router'; | ||
|
||
declare module 'vitest' { | ||
export interface TestContext { | ||
checker: (route: AppRoute, currentRoute: AppRoute | null) => boolean; | ||
routes: { | ||
foo: AppRoute; | ||
bar: AppRoute; | ||
bar_child: AppRoute; | ||
bar_child_neighbor: AppRoute; | ||
}; | ||
} | ||
} | ||
|
||
/* defaultRouteValues */ | ||
const defaults = { | ||
icon: React.createElement('i'), | ||
view: React.createElement('p'), | ||
title: '', | ||
}; | ||
|
||
beforeEach(async (context) => { | ||
const foo = { | ||
...defaults, | ||
slug: 'foo', | ||
}; | ||
|
||
const bar = { | ||
...defaults, | ||
slug: 'bar', | ||
}; | ||
|
||
const bar_child = { | ||
...defaults, | ||
slug: 'bar-child', | ||
parentRoute: 'bar', | ||
}; | ||
|
||
const bar_child_neighbor = { | ||
...defaults, | ||
slug: 'bar-child-neighbor', | ||
parentRoute: 'bar', | ||
}; | ||
|
||
context.routes = { | ||
foo, | ||
bar, | ||
bar_child, | ||
bar_child_neighbor, | ||
}; | ||
|
||
// extend context | ||
context.checker = routeVisibilityChecker(Object.values(context.routes)); | ||
}); | ||
|
||
describe('auto visibility', () => { | ||
test('top level routes always visible', ({ checker, routes }) => { | ||
expect( | ||
checker( | ||
routes.foo, // check route | ||
routes.foo, // when what active | ||
), | ||
'in case it active', | ||
).toBe(true); | ||
|
||
expect( | ||
checker( | ||
routes.foo, // check route | ||
routes.bar, // when what active | ||
), | ||
'in case it inactive', | ||
).toBe(true); | ||
}); | ||
|
||
test('nested routes visible when parent active', ({ checker, routes }) => { | ||
expect(checker(routes.bar_child, routes.bar)).toBe(true); | ||
}); | ||
|
||
test('nested routes visible when neighbor active', ({ checker, routes }) => { | ||
expect(checker(routes.bar_child, routes.bar_child_neighbor)).toBe(true); | ||
}); | ||
|
||
test('nested hidden when no active neighbor and parent', ({ checker, routes }) => { | ||
expect(checker(routes.bar_child, routes.foo)).toBe(false); | ||
}); | ||
}); |
Oops, something went wrong.