Skip to content

Commit

Permalink
further post-upgrade migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
michavie committed Feb 26, 2024
1 parent c2ac610 commit 34214b0
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions dev/src/layouts/BaseLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { DevServerConfig } from '@/config'
import { useEffect, useState } from 'react'
import { DocsNotice } from '@/components/DocsNotice'
import { trimHash, EntityTag } from '@peerme/core-ts'
import { Button, Select, Switch } from '@peerme/web-ui'
import { SimulationNotice } from '@/components/SimulationNotice'
import { Button, Select, SelectOption, Switch } from '@peerme/web-ui'
import { useExtensionLogin, useGetAccountInfo } from '@multiversx/sdk-dapp/hooks'

type Props = {
Expand Down Expand Up @@ -40,11 +40,14 @@ export const BaseLayout = (props: Props) => {
</div>
<div className="flex items-center gap-2">
<span className="text-xl text-gray-500">Tag</span>
<Select
options={toTagSelectOptions(DevServerConfig.AvailableEntityTags)}
onSelect={(val) => props.onEntityTagChange?.(val as EntityTag)}
className="w-48"
/>
<Select onChange={(val) => props.onEntityTagChange?.(val as EntityTag)} className="w-48">
<option value="-">Select Tag</option>
{DevServerConfig.AvailableEntityTags.map((tag) => (
<option key={tag} value={tag}>
{tag}
</option>
))}
</Select>
</div>
<div className="flex items-center">
{address ? (
Expand All @@ -71,9 +74,3 @@ export const BaseLayout = (props: Props) => {
</div>
)
}

const toTagSelectOptions = (tags: EntityTag[]): SelectOption[] => {
const options = tags.map((tag) => ({ name: tag, value: tag }))

return [{ name: 'Select', value: '-' }, ...options]
}

0 comments on commit 34214b0

Please sign in to comment.