Skip to content

Commit

Permalink
feat: update @pubkey-ui/core
Browse files Browse the repository at this point in the history
  • Loading branch information
beeman committed Mar 9, 2024
1 parent 5be6391 commit 2b4ea7c
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 134 deletions.
3 changes: 0 additions & 3 deletions libs/sdk/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
export * from './generated/graphql-sdk'
export * from './lib/constants'
export * from './lib/ellipsify'
export * from './lib/get-enum-options'
export * from './lib/get-graphql-client'
export * from './lib/get-graphql-sdk'
export * from './lib/get-random-int'
export * from './lib/response-middleware'
export * from './lib/verify-signature'
8 changes: 0 additions & 8 deletions libs/sdk/src/lib/get-enum-options.ts

This file was deleted.

12 changes: 0 additions & 12 deletions libs/sdk/src/lib/get-random-int.ts

This file was deleted.

26 changes: 0 additions & 26 deletions libs/sdk/src/lib/verify-signature.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button, Group } from '@mantine/core'
import { AdminCreateIdentityInput, getEnumOptions, IdentityProvider } from '@pubkey-stack/sdk'
import { formFieldSelect, formFieldText, UiForm, UiFormField } from '@pubkey-ui/core'
import { AdminCreateIdentityInput, IdentityProvider } from '@pubkey-stack/sdk'
import { formFieldSelect, formFieldText, getEnumOptions, UiForm, UiFormField } from '@pubkey-ui/core'

export function AuthUiIdentityCreateForm({ submit }: { submit: (res: AdminCreateIdentityInput) => Promise<boolean> }) {
const model: AdminCreateIdentityInput = {
Expand Down
2 changes: 0 additions & 2 deletions libs/web/ui/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
export * from './lib/ui-avatar'
export * from './lib/ui-grid'
export * from './lib/ui-header-profile'
export * from './lib/ui-modal-button'
export * from './lib/ui-page-limit'
export * from './lib/ui-search-field'
export * from './lib/ui-select-enum-option'
29 changes: 0 additions & 29 deletions libs/web/ui/core/src/lib/ui-avatar.tsx

This file was deleted.

5 changes: 2 additions & 3 deletions libs/web/ui/core/src/lib/ui-header-profile.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Button, Menu } from '@mantine/core'
import { User, UserRole } from '@pubkey-stack/sdk'
import { useUiColorScheme } from '@pubkey-ui/core'
import { UiAvatar, useUiColorScheme } from '@pubkey-ui/core'
import { IconBug, IconLogout, IconMoonStars, IconSettings, IconShield, IconSun, IconUser } from '@tabler/icons-react'
import { useState } from 'react'
import { Link } from 'react-router-dom'
import { UiAvatar } from './ui-avatar'

export function UiHeaderProfile({ user, logout }: { user?: User | null; logout: () => void }) {
const { colorScheme, toggleColorScheme } = useUiColorScheme()
Expand All @@ -26,7 +25,7 @@ export function UiHeaderProfile({ user, logout }: { user?: User | null; logout:
<Menu.Target>
<Button p={0} variant={open ? 'light' : 'default'} radius="xl">
<UiAvatar
avatarUrl={user?.avatarUrl}
url={user?.avatarUrl}
name={user?.username}
alt={user?.username ?? 'User Avatar'}
radius={100}
Expand Down
19 changes: 0 additions & 19 deletions libs/web/ui/core/src/lib/ui-select-enum-option.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions libs/web/user/feature/src/lib/admin-user-list-feature.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export function AdminUserListFeature() {
>
<Group>
<UiSearchField placeholder="Search user" setSearch={setSearch} />
<AdminUserUiSelectRole value={role} onChange={setRole} />
<AdminUserUiSelectStatus value={status} onChange={setStatus} />
<AdminUserUiSelectRole value={role} setValue={setRole} />
<AdminUserUiSelectStatus value={status} setValue={setStatus} />
<UiPageLimit limit={pagination.limit} setLimit={pagination.setLimit} setPage={pagination.setPage} />
</Group>

Expand Down
12 changes: 6 additions & 6 deletions libs/web/user/feature/src/lib/admin-user-ui-select-role.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { getEnumOptions, UserRole } from '@pubkey-stack/sdk'
import { UiSelectEnumOption } from '@pubkey-stack/web-ui-core'
import { UserRole } from '@pubkey-stack/sdk'
import { getEnumOptions, UiSelectEnum } from '@pubkey-ui/core'

export function AdminUserUiSelectRole({
value,
onChange,
setValue,
}: {
value: UserRole | undefined
onChange: (role: UserRole | undefined) => void
setValue: (role: UserRole | undefined) => void
}) {
return (
<UiSelectEnumOption<UserRole>
<UiSelectEnum<UserRole>
value={value}
onChange={onChange}
setValue={setValue}
options={[{ value: '', label: 'Filter by role' }, ...getEnumOptions(UserRole)]}
/>
)
Expand Down
12 changes: 6 additions & 6 deletions libs/web/user/feature/src/lib/admin-user-ui-select-status.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { getEnumOptions, UserStatus } from '@pubkey-stack/sdk'
import { UiSelectEnumOption } from '@pubkey-stack/web-ui-core'
import { UserStatus } from '@pubkey-stack/sdk'
import { getEnumOptions, UiSelectEnum } from '@pubkey-ui/core'

export function AdminUserUiSelectStatus({
value,
onChange,
setValue,
}: {
value: UserStatus | undefined
onChange: (value: UserStatus | undefined) => void
setValue: (value: UserStatus | undefined) => void
}) {
return (
<UiSelectEnumOption<UserStatus>
<UiSelectEnum<UserStatus>
value={value}
onChange={onChange}
setValue={setValue}
options={[{ value: '', label: 'Filter by status' }, ...getEnumOptions(UserStatus)]}
/>
)
Expand Down
4 changes: 2 additions & 2 deletions libs/web/user/ui/src/lib/admin-user-ui-update-form.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button, Group } from '@mantine/core'
import { AdminUpdateUserInput, getEnumOptions, User, UserRole, UserStatus } from '@pubkey-stack/sdk'
import { formFieldCheckbox, formFieldSelect, formFieldText, UiForm, UiFormField } from '@pubkey-ui/core'
import { AdminUpdateUserInput, User, UserRole, UserStatus } from '@pubkey-stack/sdk'
import { formFieldCheckbox, formFieldSelect, formFieldText, getEnumOptions, UiForm, UiFormField } from '@pubkey-ui/core'

export function AdminUiUpdateUserForm({
submit,
Expand Down
4 changes: 2 additions & 2 deletions libs/web/user/ui/src/lib/user-ui-avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { User } from '@pubkey-stack/sdk'
import { UiAvatar, UiAvatarProps } from '@pubkey-stack/web-ui-core'
import { UiAvatar, UiAvatarProps } from '@pubkey-ui/core'

export type UserUiAvatarProps = UiAvatarProps & {
user?: User
}

export function UserUiAvatar({ user, ...props }: UserUiAvatarProps) {
return <UiAvatar avatarUrl={user?.avatarUrl} name={user?.username} {...props} />
return <UiAvatar url={user?.avatarUrl} name={user?.username} {...props} />
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
"@nestjs/serve-static": "^4.0.0",
"@nx/devkit": "17.2.8",
"@prisma/client": "5.8.0",
"@pubkey-ui/core": "^1.4.1",
"@pubkey-ui/generators": "^1.4.1",
"@pubkey-ui/core": "^1.6.0",
"@pubkey-ui/generators": "^1.6.0",
"@pubkeyapp/solana-verify-wallet": "^1.3.3",
"@pubkeyapp/wallet-adapter-mantine-ui": "^2.3.0",
"@solana/spl-token": "^0.3.11",
Expand Down
18 changes: 8 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2b4ea7c

Please sign in to comment.