Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ testem.log
# System Files
.DS_Store
Thumbs.db

# Custom
*.env
1 change: 1 addition & 0 deletions libs/shared/components/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './lib/rt/rt';
export * from './lib/header/header';
export * from './lib/button/button';
export * from './lib/page-title/page-title';
Expand Down
Empty file.
10 changes: 10 additions & 0 deletions libs/shared/components/src/lib/rt/rt.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { render } from '@testing-library/react';

import Rt from './rt';

describe('Rt', () => {
it('should render successfully', () => {
const { baseElement } = render(<Rt />);
expect(baseElement).toBeTruthy();
});
});
16 changes: 16 additions & 0 deletions libs/shared/components/src/lib/rt/rt.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import './rt.scss';
import ReactMarkdown from 'react-markdown';
import remarkGfm from 'remark-gfm';
import { tr } from '@alpsbte/shared/language';

/* eslint-disable-next-line */
export interface RtProps {
p: any; // get correct time in the future
}

export function Rt(props: RtProps) {
const markdown = tr(props.p);
return <ReactMarkdown children={markdown} remarkPlugins={[remarkGfm]} />;
}

export default Rt;
9 changes: 6 additions & 3 deletions libs/shared/language/src/lib/tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
import { languageStore } from '@alpsbte/shared/stores';
import { deepFind, InternalError } from '@alpsbte/shared/util';
import { ISet } from './interfaces/set';
import ReactMarkdown from 'react-markdown'
import remarkGfm from 'remark-gfm'


type Divider = '.';
type ___ = '';
Expand Down Expand Up @@ -41,7 +44,7 @@ export type TranslationPath = TranslationPathFactory<typeof languageStore.set>;
* Only works in components that have the languageStore injected!
*/
export function tr(key: TranslationPath): string {
return (
deepFind<ISet>(languageStore.set, key) ?? InternalError.missingTranslation
);
const text = (deepFind<ISet>(languageStore.set, key) ??
InternalError.missingTranslation) as string;
return text;
}
4 changes: 4 additions & 0 deletions libs/shared/theme/src/lib/styles/link.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ a {

a.link {
color: colors.$link;

&:visited {
color: colors.$link-visited;
}
}
3 changes: 2 additions & 1 deletion libs/shared/theme/src/lib/variables/colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ $green: #45c631;
$orange: #ffa202;

//misc
$link: #96AFEA
$link: #96afea;
$link-visited: #b680e7;
Loading