Skip to content

Commit

Permalink
Merge pull request #1046 from rainlanguage/2024-12-05-migrate-licence…
Browse files Browse the repository at this point in the history
…-route

2024 12 05 migrate licence route
  • Loading branch information
hardyjosh authored Dec 6, 2024
2 parents 25d28a6 + abea657 commit d5903ec
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 60 deletions.
19 changes: 19 additions & 0 deletions packages/ui-components/src/lib/components/Heading.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<script>
export let depth;
</script>

{#if depth === 1}
<div class="mb-4 text-4xl font-medium dark:text-white"><slot /></div>
{:else if depth === 2}
<div class="my-4 text-2xl font-medium dark:text-white"><slot /></div>
{:else if depth === 3}
<div class="my-4 text-xl font-medium dark:text-white"><slot /></div>
{:else if depth === 4}
<div class="my-4 text-lg font-medium dark:text-white"><slot /></div>
{:else if depth === 5}
<h5><slot /></h5>
{:else if depth === 6}
<h6><slot /></h6>
{:else}
<slot />
{/if}
12 changes: 12 additions & 0 deletions packages/ui-components/src/lib/components/Text.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script>
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
export let text;
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
text;
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
export let raw;
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
raw;
</script>

<div class="my-2 mb-3"><slot /></div>
3 changes: 3 additions & 0 deletions packages/ui-components/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export { default as LightweightChart } from './components/charts/LightweightChar
export { default as TanstackLightweightChartLine } from './components/charts/TanstackLightweightChartLine.svelte';
export { default as MockComponent } from './__mocks__/MockComponent.svelte';
export { default as Checkbox } from './components/checkbox/Checkbox.svelte';
export { default as BlockQuote } from './components/BlockQuote.svelte';
export { default as Heading } from './components/Heading.svelte';
export { default as Text } from './components/Text.svelte';

//Types
export type { AppStoresInterface } from './types/appStores.ts';
Expand Down
31 changes: 2 additions & 29 deletions tauri-app/src/routes/license/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,32 +1,5 @@
<script>
import Heading from './Heading.svelte';
import Markdown from 'svelte-markdown';
import { onMount } from 'svelte';
import Text from './Text.svelte';
import BlockQuote from './BlockQuote.svelte';
let source = '';
onMount(async () => {
try {
const response = await fetch(
'https://raw.githubusercontent.com/rainlanguage/decentralicense/refs/heads/master/README.md',
);
if (response.ok) {
source = await response.text();
}
} catch {
source = '';
}
});
import License from './License.svelte';
</script>

<Markdown
{source}
renderers={{
text: Text,
heading: Heading,
blockquote: BlockQuote,
}}
/>
<License />
19 changes: 0 additions & 19 deletions tauri-app/src/routes/license/Heading.svelte

This file was deleted.

32 changes: 32 additions & 0 deletions tauri-app/src/routes/license/License.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<script>
import { Heading } from '@rainlanguage/ui-components';
import Markdown from 'svelte-markdown';
import { onMount } from 'svelte';
import { Text } from '@rainlanguage/ui-components';
import { BlockQuote } from '@rainlanguage/ui-components';
let source = '';
onMount(async () => {
try {
const response = await fetch(
'https://raw.githubusercontent.com/rainlanguage/decentralicense/refs/heads/master/README.md',
);
if (response.ok) {
source = await response.text();
}
} catch {
source = '';
}
});
</script>

<Markdown
{source}
renderers={{
text: Text,
heading: Heading,
blockquote: BlockQuote,
}}
/>
12 changes: 0 additions & 12 deletions tauri-app/src/routes/license/Text.svelte

This file was deleted.

0 comments on commit d5903ec

Please sign in to comment.