diff --git a/client/src/components/Playground.vue b/client/src/components/Playground.vue index a9db0f1..db120fd 100644 --- a/client/src/components/Playground.vue +++ b/client/src/components/Playground.vue @@ -1,9 +1,66 @@ \ No newline at end of file diff --git a/client/src/components/SourceCard.vue b/client/src/components/SourceCard.vue new file mode 100644 index 0000000..b839fb4 --- /dev/null +++ b/client/src/components/SourceCard.vue @@ -0,0 +1,28 @@ + + + + + \ No newline at end of file diff --git a/client/src/composables/engine/fetchUpdate.ts b/client/src/composables/engine/fetchUpdate.ts index 25299b2..9e0333a 100644 --- a/client/src/composables/engine/fetchUpdate.ts +++ b/client/src/composables/engine/fetchUpdate.ts @@ -1,6 +1,7 @@ import { useEngineStore } from "@/stores/EngineStore" import { useUserinfoStore } from "@/stores/UserinfoStore" import { useGameinfoStore } from "@/stores/GameinfoStore" +import { useRoundStore } from "@/stores/RoundStore" import { usePlayersStore } from "@/stores/PlayersStore" export async function fetchUpdate() { @@ -29,6 +30,7 @@ export async function fetchUpdate() { useEngineStore().setJson(response) useGameinfoStore().setGameinfo(response.game) + useRoundStore().setRound(response.game.round) usePlayersStore().setPlayers(response.game.players) // apply rate limit diff --git a/client/src/stores/RoundStore.ts b/client/src/stores/RoundStore.ts new file mode 100644 index 0000000..50b33a0 --- /dev/null +++ b/client/src/stores/RoundStore.ts @@ -0,0 +1,29 @@ +import { defineStore } from 'pinia' + +export type Source = { + id: string + name: string +} + +export type Round = { + quote: string + sources: Array +} + +export const useRoundStore = defineStore('RoundStore', { + state: () => { + return { + round: { + quote: '', + sources: [], + } as Round, + } + }, + actions: { + setRound(round: Round): void { + round = round || {} as Round + this.round.quote = round.quote + this.round.sources = round.sources + }, + }, +})