Skip to content

Commit

Permalink
feat: auto hide team when outdated
Browse files Browse the repository at this point in the history
  • Loading branch information
logonoff committed Nov 14, 2024
1 parent d9f2ee2 commit cf5bb64
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v4
with:
repository: UTM-Robotics/team-images
path: "src/lib/team"
path: 'src/lib/team'
ssh-key: ${{ secrets.DEPLOY_KEY }}

- name: create env files
Expand Down
22 changes: 13 additions & 9 deletions src/lib/components/Team.svelte
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
<script lang="ts">
import { team, type TeamMemberProps } from '$lib/team/team';
import { team, expires, type TeamMemberProps } from '$lib/team/team';
import TeamMember from '$lib/components/TeamMember.svelte';
const today = new Date();
</script>

<section class="about-team">
<h2 class="section-header">Meet the Team</h2>
{#if today.getTime() < expires.getTime()}
<section class="about-team">
<h2 class="section-header">Meet the Team</h2>

<div class="about-team-members">
{#each team as member}
<TeamMember {...member as TeamMemberProps} />
{/each}
</div>
</section>
<div class="about-team-members">
{#each team as member}
<TeamMember {...member as TeamMemberProps} />
{/each}
</div>
</section>
{/if}

<style>
.about-team {
Expand Down
31 changes: 18 additions & 13 deletions src/lib/team/team.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
export interface TeamMemberProps {
name: string;
role?: string;
bio?: string;
image?: string;
linkedin?: string;
github?: string;
}

/**
* stub data
*/
export const team: TeamMemberProps[] = [];
export interface TeamMemberProps {
name: string;
role?: string;
bio?: string;
image?: string;
linkedin?: string;
github?: string;
}

/**
* stub data
*/
export const team: TeamMemberProps[] = [];

/**
* when to stop showing this data
*/
export const expires = new Date(0);

0 comments on commit cf5bb64

Please sign in to comment.