Skip to content

Commit

Permalink
Merge pull request #8176 from OpenMined/fix/frontend-fb
Browse files Browse the repository at this point in the history
fix: reduce fe to metadata info
  • Loading branch information
madhavajay authored Oct 20, 2023
2 parents 1bae336 + 4ee0b9d commit c4ae31f
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 1,306 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@
import Badge from '$lib/components/Badge.svelte';
import TagCloud from '$lib/components/TagCloud.svelte';
import DomainOnlineIndicator from '$lib/components/DomainOnlineIndicator.svelte';
import { getInitials } from '$lib/utils';
import type { DomainMetadata } from '../../../types/domain/metadata';
export let metadata: DomainMetadata;
$: initials = metadata
? metadata?.name
?.split(' ')
.map((n) => n[0])
.join('')
: '';
$: domainInitials = getInitials(metadata?.name);
</script>

<section class="flex flex-col w-full sm:w-[36%] sm:min-w-[544px] max-w-[784px] gap-4 py-11 px-8">
Expand All @@ -22,17 +18,12 @@
<div class="absolute right-0">
<DomainOnlineIndicator />
</div>
<Avatar {initials} />
<Avatar bigText initials={domainInitials} />
</div>
<h2>{metadata.name}</h2>
{#if metadata.organization}
<p class="text-lg font-semibold flex-shrink-0">{metadata.organization}</p>
{/if}
{#if metadata.description}
<p class="text-base">
{metadata.description}
</p>
{/if}
<hr />
<div class="flex flex-col gap-2.5 flex-shrink-0 pt-2 pb-4">
<div class="flex gap-1 items-center group relative">
Expand Down
6 changes: 3 additions & 3 deletions packages/grid/frontend/src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { ServiceRoles } from '../types/domain/users';

export function prettyName(name) {
let nameList = name.split('_');
for (var i = 0; i < nameList.length; i++) {
const nameList = name.split('_');
for (let i = 0; i < nameList.length; i++) {
nameList[i] = nameList[i].charAt(0).toUpperCase() + nameList[i].slice(1);
}
return nameList.join(' ');
}

export function shortName(name) {
let nameList = name.split(' ');
const nameList = name.split(' ');
let letters = '';
nameList[0].charAt(0).toUpperCase();
if (nameList.length < 2) {
Expand Down
26 changes: 0 additions & 26 deletions packages/grid/frontend/src/routes/(app)/+layout.svelte

This file was deleted.

203 changes: 0 additions & 203 deletions packages/grid/frontend/src/routes/(app)/account/+page.svelte

This file was deleted.

Loading

0 comments on commit c4ae31f

Please sign in to comment.