-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/dwa #196
Merged
Merged
Feat/dwa #196
Changes from 50 commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
5dcc4c8
feat:dwa-starter-vue-app-hello-word
Johnnyevans32 1a60fdb
feat:dwa-starter-vue-app-hello-word
Johnnyevans32 722e6ba
feat:dwa-starter-vue-app-hello-word
Johnnyevans32 eb70ad6
added tailwind css
Johnnyevans32 5db4bad
added tailwind css
Johnnyevans32 6b58d57
added tbd example json for ci integration
Johnnyevans32 53399f8
added tbd example json for ci integration
Johnnyevans32 8dc06e1
replaced npm with pnpm in ci/cd file
Johnnyevans32 bf9ade2
fix:pnpm build error in ci/cd
Johnnyevans32 323a6f8
fix:pnpm build error in ci/cd
Johnnyevans32 c855e5f
fix:pnpm build error in ci/cd
Johnnyevans32 61e7bf9
break the commands into seperate items
Johnnyevans32 71f033f
break the commands into seperate items
Johnnyevans32 d1c191b
Setup routes for Home, About, Settings and 404 handling
Johnnyevans32 0cbffbd
Setup routes for Home, About, Settings and 404 handling
Johnnyevans32 bf4b6bd
conflict fix
Johnnyevans32 817dd9d
remove vite config timestamp file
Johnnyevans32 45863c1
remove vite config timestamp file
Johnnyevans32 299701c
initial commit
Johnnyevans32 2d4bc05
initial commit
Johnnyevans32 8f52853
fix:layout
Johnnyevans32 f5acb27
fix:layout
Johnnyevans32 0e5cdd8
fix:layout
Johnnyevans32 840901f
fix:layout
Johnnyevans32 ca39e83
responsive nav menu
Johnnyevans32 4d506f6
responsive nav menu
Johnnyevans32 d7f09f3
responsive nav menu
Johnnyevans32 af78a4d
backdrop blur
Johnnyevans32 fd9e803
updated dark mode specs
Johnnyevans32 927738f
vite plugin pwa
Johnnyevans32 ec39945
conflict fix
Johnnyevans32 9e83878
remove unused navigation menu component
Johnnyevans32 a728cd6
conflict fix
Johnnyevans32 3ad3b3a
pwa assets generation and settings page form
Johnnyevans32 968615c
pwa assets generation and settings page form
Johnnyevans32 74cd639
web5 connection setup
Johnnyevans32 7cce532
web5 connection setup
Johnnyevans32 405d8ae
test case fix
Johnnyevans32 c60f4fd
test unit specs update
Johnnyevans32 c504971
Merge branch 'feat/pwa' of https://github.com/Johnnyevans32/tbd-examp…
Johnnyevans32 456bbda
test unit specs update
Johnnyevans32 fee7ea8
ci fix
Johnnyevans32 0ef7b9f
ci fix
Johnnyevans32 f390c32
ci fix
Johnnyevans32 e35b107
conflict fix
Johnnyevans32 d53936f
delete todo unused store
Johnnyevans32 d87bfeb
conflict fix
Johnnyevans32 3c3bf8f
conflict fix
Johnnyevans32 0c8ce1f
seperate web5 connect options button loading state
Johnnyevans32 174d9fc
seperate web5 connect options button loading state
Johnnyevans32 98530bf
revert web5 composable to resemble that of the react vite version
Johnnyevans32 155c104
Merge branch 'main' of https://github.com/TBD54566975/tbd-examples in…
Johnnyevans32 fc569ee
revert to importing react linb utilties
Johnnyevans32 c3ead1c
revert to importing react linb utilties
Johnnyevans32 7b776d7
update
Johnnyevans32 5331f5a
update
Johnnyevans32 d189d2a
update
Johnnyevans32 695280a
update
Johnnyevans32 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
javascript/dwa-starter-vue/src/types.d.ts → javascript/dwa-starter-vue/globals.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<script setup lang="ts"> | ||
import { Button } from '@/components/ui/button' | ||
import { useRoute } from 'vue-router' | ||
import { HomeIcon, GearIcon, AvatarIcon } from '@radix-icons/vue' | ||
|
||
import { | ||
DropdownMenu, | ||
DropdownMenuContent, | ||
DropdownMenuItem, | ||
DropdownMenuTrigger | ||
} from '@/components/ui/dropdown-menu' | ||
import { Icon } from '@iconify/vue' | ||
|
||
import { useColorMode } from '@vueuse/core' | ||
import { storeToRefs } from 'pinia' | ||
import { useWeb5Store } from '@/stores/web5' | ||
import { computed } from 'vue' | ||
import Web5ConnectButton from '@/components/Web5ConnectButton.vue' | ||
|
||
const route = useRoute() | ||
|
||
const { web5 } = storeToRefs(useWeb5Store()) | ||
const navList = computed(() => [ | ||
{ title: 'Home', href: '/', icon: HomeIcon }, | ||
{ title: 'About', href: '/about', icon: AvatarIcon }, | ||
...(web5.value ? [{ title: 'Settings', href: '/settings', icon: GearIcon }] : []) | ||
]) | ||
|
||
const emit = defineEmits(['itemClicked']) | ||
|
||
const mode = useColorMode() | ||
const handleModeOptionClick = (value: 'light' | 'dark' | 'auto') => { | ||
mode.value = value | ||
emit('itemClicked') | ||
} | ||
</script> | ||
|
||
<template> | ||
<nav class="flex flex-col justify-between h-full"> | ||
<div class="flex flex-col gap-2"> | ||
<div class="flex items-center justify-between"> | ||
<h2 class="text-lg">My DWA</h2> | ||
<DropdownMenu> | ||
<DropdownMenuTrigger as-child> | ||
<Button variant="ghost" class="dark:bg-zinc-950 dark:text-white"> | ||
<Icon | ||
icon="radix-icons:moon" | ||
class="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" | ||
/> | ||
<Icon | ||
icon="radix-icons:sun" | ||
class="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" | ||
/> | ||
<span class="sr-only">Toggle theme</span> | ||
</Button> | ||
</DropdownMenuTrigger> | ||
<DropdownMenuContent align="end" class="dark:bg-zinc-950 dark:text-white"> | ||
<DropdownMenuItem @click="handleModeOptionClick('light')"> Light </DropdownMenuItem> | ||
<DropdownMenuItem @click="handleModeOptionClick('dark')"> Dark </DropdownMenuItem> | ||
<DropdownMenuItem @click="handleModeOptionClick('auto')"> System </DropdownMenuItem> | ||
</DropdownMenuContent> | ||
</DropdownMenu> | ||
</div> | ||
<div class="flex flex-col gap-2"> | ||
<div v-for="item in navList" :key="item.title"> | ||
<Button | ||
:variant="route.path === item.href ? 'secondary' : 'ghost'" | ||
class="w-full justify-start" | ||
asChild | ||
> | ||
<RouterLink :to="item.href" @click="emit('itemClicked')"> | ||
<component :is="item.icon" class="w-4 h-4 mr-2" /> | ||
{{ item.title }} | ||
</RouterLink> | ||
</Button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<Web5ConnectButton /> | ||
</nav> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<script setup lang="ts"></script> | ||
|
||
<template> | ||
<h1>Todo</h1> | ||
<p>coming soon</p> | ||
</template> |
79 changes: 79 additions & 0 deletions
79
javascript/dwa-starter-vue/src/components/Web5ConnectButton.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<script lang="ts" setup> | ||
import { ref } from 'vue' | ||
import { Button } from '@/components/ui/button' | ||
import { useWeb5Connection } from '@/composables/web5Connection' | ||
import { Link2Icon, ReloadIcon, LinkBreak2Icon, Cross1Icon } from '@radix-icons/vue' | ||
|
||
import { | ||
Drawer, | ||
DrawerContent, | ||
DrawerDescription, | ||
DrawerHeader, | ||
DrawerTitle, | ||
DrawerTrigger, | ||
DrawerFooter, | ||
DrawerClose | ||
} from '@/components/ui/drawer' | ||
import { storeToRefs } from 'pinia' | ||
import { useWeb5Store } from '@/stores/web5' | ||
|
||
const isOpen = ref(false) | ||
|
||
const { connect, walletConnect, isWeb5ConnectLoading, isWeb5WalletConnectLoading } = | ||
useWeb5Connection() | ||
const { web5 } = storeToRefs(useWeb5Store()) | ||
|
||
const truncateString = (data: string) => `${data.substring(0, 7)}...${data.slice(data.length - 4)}` | ||
</script> | ||
|
||
<template> | ||
<p v-if="web5">hi, {{ truncateString(web5.did) }}</p> | ||
<Drawer v-else v-model:open="isOpen"> | ||
<DrawerTrigger as-child> | ||
<Button variant="outline" class="w-full dark:bg-zinc-950 dark:text-white"> | ||
<Link2Icon class="w-4 h-4 mr-2" /> | ||
Connect | ||
</Button> | ||
</DrawerTrigger> | ||
<DrawerContent class="dark:bg-zinc-950 dark:text-white"> | ||
<DrawerHeader class="flex flex-col items-center"> | ||
<DrawerTitle>Connect to Web5</DrawerTitle> | ||
<DrawerDescription>Select how you'd like to connect below.</DrawerDescription> | ||
</DrawerHeader> | ||
<div class="flex flex-col gap-2 p-4 items-center"> | ||
<Button | ||
variant="outline" | ||
:disabled="isWeb5ConnectLoading || isWeb5WalletConnectLoading" | ||
class="lg:w-1/3 w-full dark:bg-zinc-950 dark:text-white" | ||
@click="connect" | ||
> | ||
<ReloadIcon v-if="isWeb5ConnectLoading" class="w-4 h-4 mr-2 animate-spin" /> | ||
<div v-else class="flex items-center"> | ||
<Link2Icon class="w-4 h-4 mr-2" /> Local Agent Connect | ||
</div> | ||
</Button> | ||
|
||
<Button | ||
variant="outline" | ||
:disabled="isWeb5ConnectLoading || isWeb5WalletConnectLoading" | ||
class="lg:w-1/3 w-full dark:bg-zinc-950 dark:text-white" | ||
@click="walletConnect" | ||
> | ||
<ReloadIcon v-if="isWeb5WalletConnectLoading" class="w-4 h-4 mr-2 animate-spin" /> | ||
<div v-else class="flex items-center"> | ||
<LinkBreak2Icon class="w-4 h-4 mr-2" /> Wallet Connect | ||
</div> | ||
</Button> | ||
</div> | ||
<DrawerFooter> | ||
<DrawerClose as-child> | ||
<Button | ||
variant="outline" | ||
class="lg:w-1/3 w-full place-self-center bg-red-500 text-white dark:bg-red-500 dark:text-white" | ||
><Cross1Icon class="w-4 h-4 mr-2" /> Cancel | ||
</Button> | ||
</DrawerClose> | ||
</DrawerFooter> | ||
</DrawerContent> | ||
</Drawer> | ||
</template> |
19 changes: 19 additions & 0 deletions
19
javascript/dwa-starter-vue/src/components/ui/drawer/Drawer.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script lang="ts" setup> | ||
import type { DrawerRootEmits, DrawerRootProps } from 'vaul-vue' | ||
import { DrawerRoot } from 'vaul-vue' | ||
import { useForwardPropsEmits } from 'radix-vue' | ||
|
||
const props = withDefaults(defineProps<DrawerRootProps>(), { | ||
shouldScaleBackground: true, | ||
}) | ||
|
||
const emits = defineEmits<DrawerRootEmits>() | ||
|
||
const forwarded = useForwardPropsEmits(props, emits) | ||
</script> | ||
|
||
<template> | ||
<DrawerRoot v-bind="forwarded"> | ||
<slot /> | ||
</DrawerRoot> | ||
</template> |
28 changes: 28 additions & 0 deletions
28
javascript/dwa-starter-vue/src/components/ui/drawer/DrawerContent.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<script lang="ts" setup> | ||
import { DrawerContent, DrawerPortal } from 'vaul-vue' | ||
import type { DialogContentEmits, DialogContentProps } from 'radix-vue' | ||
import { useForwardPropsEmits } from 'radix-vue' | ||
import type { HtmlHTMLAttributes } from 'vue' | ||
import DrawerOverlay from './DrawerOverlay.vue' | ||
import { cn } from '@/lib/utils' | ||
|
||
const props = defineProps<DialogContentProps & { class?: HtmlHTMLAttributes['class'] }>() | ||
const emits = defineEmits<DialogContentEmits>() | ||
|
||
const forwarded = useForwardPropsEmits(props, emits) | ||
</script> | ||
|
||
<template> | ||
<DrawerPortal> | ||
<DrawerOverlay /> | ||
<DrawerContent | ||
v-bind="forwarded" :class="cn( | ||
'fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border border-slate-200 bg-white dark:border-slate-800 dark:bg-slate-950', | ||
props.class, | ||
)" | ||
> | ||
<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-slate-100 dark:bg-slate-800" /> | ||
<slot /> | ||
</DrawerContent> | ||
</DrawerPortal> | ||
</template> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need help with this test or are you planning to add it back in one of the other projects tasks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I do actually, i was going to get more info on this after finishing up the main pages components
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets do this... hold off on this test for now, and lets merge this pr as soon as you address my points above. then after that I can work on mocking/setting up the connection in playwright while you work on your next task. this way we dont block you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotcha thanks!