Skip to content

Commit

Permalink
Revert "feat: added global components"
Browse files Browse the repository at this point in the history
This reverts commit 758f705.
  • Loading branch information
bbtgnn committed Mar 1, 2024
1 parent 0479cda commit 1d335c3
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 24 deletions.
3 changes: 0 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@
"workbench.colorTheme": "Material Theme High Contrast",
"workbench.colorCustomizations": {
"[Material Theme Palenight High Contrast]": {}
},
"svelte.plugin.svelte.compilerWarnings": {
"missing-declaration": "ignore"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"build": "vite build",
"preview": "vite preview",
"test": "npm run test:integration && npm run test:unit",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --compiler-warnings 'missing-declaration:ignore'",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch --compiler-warnings 'missing-declaration:ignore'",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write .",
"test:integration": "playwright test",
Expand Down
7 changes: 2 additions & 5 deletions src/_modules/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import _ from 'lodash';

import Doc from './Document.svelte';
import Document from './Document.svelte';
import DocumentContent from './DocumentContent.svelte';
import Collection from './Collection.svelte';
import Relation from './Relation.svelte';
import LogBanner from './LogBanner.svelte';

_.assign(globalThis, { Doc });
export { Doc, DocumentContent, Collection, Relation, LogBanner };
export { Document, DocumentContent, Collection, Relation, LogBanner };
4 changes: 0 additions & 4 deletions src/app.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Doc as DocComponent } from '$modules/components';

// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
declare global {
Expand All @@ -10,8 +8,6 @@ declare global {
// interface PageState {}
// interface Platform {}
}

const Doc: typeof DocComponent;
}

export {};
5 changes: 3 additions & 2 deletions src/routes/(database)/organizations/dyne/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts" context="module">
import { db } from '$modules';
import { Document } from '$modules/components';
import logo from './logo.jpeg';
export const props = db.create('organizations', {
Expand All @@ -12,7 +13,7 @@
<p>Mo bellissima dyne</p>
<img src="./logo.jpeg" alt="dyne logo" />

<Doc collection="organizations" name="freelance" let:doc>
<Document collection="organizations" name="freelance" let:doc>
<pre>{JSON.stringify(doc, null, 2)}</pre>
</Doc>
</Document>
<img src={logo} alt="dyne logo" />
6 changes: 3 additions & 3 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { Collection, Relation } from '$modules/components';
import { Collection, Document, Relation } from '$modules/components';
import DocumentContent from '$modules/components/DocumentContent.svelte';
import { db } from '$modules/index';
import { href } from '$modules/utils';
Expand All @@ -17,10 +17,10 @@
<div>
<a href={href('/cv')} class="button">CV</a>

<Doc collection="organizations" name="dyne" let:doc>
<Document collection="organizations" name="dyne" let:doc>
<pre>{JSON.stringify(doc)}</pre>
<img alt="ciao" src={doc.props?.logo} />
</Doc>
</Document>

<hr />

Expand Down
15 changes: 10 additions & 5 deletions src/routes/cv/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts">
import Collection from '$modules/components/Collection.svelte';
import Document from '$modules/components/Document.svelte';
import Relation from '$modules/components/Relation.svelte';
import { href } from '$modules/utils';
import { formatDate } from 'date-fns/format';
Expand All @@ -14,13 +15,13 @@
{#if document.props?.current}
<div class="rounded-xl border border-stone-300 p-4">
<p>{document.props.roles.join(', ')}</p>
<Doc
<Document
collection={document.props.employer.collection}
name={document.props.employer.document}
let:doc
>
<p>{doc.props?.name}</p>
</Doc>
</Document>
<p>
<span>
{formatDate(document.props.date_start, 'MM / yyyy')}
Expand All @@ -29,7 +30,7 @@
<span> oggi </span>
</p>
</div>
<Doc collection="education" name="triennio-isia-urbino"></Doc>
<!-- <pre>{JSON.stringify(document, null, 2)}</pre> -->
{/if}
{/each}

Expand All @@ -38,9 +39,13 @@
{#if document.props?.date_end}
<div class="rounded-xl border border-stone-300 p-4">
<p>{document.props.roles.join(', ')}</p>
<Doc collection="organizations" name={document.props.employer.document} let:doc>
<Document
collection={document.props.employer.collection}
name={document.props.employer.document}
let:doc
>
<p>{doc.props?.name}</p>
</Doc>
</Document>
<p>
<span>
{formatDate(document.props.date_start, 'MM / yyyy')}
Expand Down

0 comments on commit 1d335c3

Please sign in to comment.