Skip to content

Commit f040110

Browse files
authored
Merge pull request #100 from oasisprotocol/mz/syncMeeting
Align app with sync meeting requirements
2 parents 6a9744d + 612df0d commit f040110

File tree

17 files changed

+58
-33
lines changed

17 files changed

+58
-33
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "rofl-app",
33
"private": true,
4-
"version": "0.0.0",
4+
"version": "0.9.0",
55
"type": "module",
66
"scripts": {
77
"checkTs": "tsc --noEmit",

src/coin-gecko/api.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type GetRosePriceResponse = {
88

99
const staleTime = 1000 * 60 * 3 // 3 minutes
1010

11-
export function useGetRosePrice() {
11+
export function useGetRosePrice(options?: { enabled?: boolean }) {
1212
return useQuery<number, AxiosError<unknown>>({
1313
queryKey: ['rosePrice'],
1414
queryFn: () =>
@@ -22,5 +22,6 @@ export function useGetRosePrice() {
2222
.then(({ data }) => data['oasis-network'].usd),
2323
staleTime,
2424
throwOnError: false,
25+
enabled: options?.enabled ?? true,
2526
})
2627
}

src/components/AppsList/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const AppsList: FC<AppsListProps> = ({ emptyState, type }) => {
2626
limit: pageLimit,
2727
offset: pageParam,
2828
admin: type === 'dashboard' ? address : undefined,
29+
sort_by: type === 'dashboard' ? 'created_at_desc' : undefined,
2930
})
3031
return result
3132
},

src/components/Layout/MainLayout.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,24 @@ export const MainLayout: FC = () => {
162162
<div className="bg-sidebar-accent p-4 rounded-md text-sm text-foreground">
163163
<span className="font-bold">Running in Beta.</span>
164164
<br />
165-
<a href="#" target="_blank" rel="noopener noreferrer" className="underline text-foreground">
166-
Click to provide feedback.
165+
<a
166+
href="https://forms.gle/yewQDdMzNg81wKtw9"
167+
target="_blank"
168+
rel="noopener noreferrer"
169+
className="underline text-foreground"
170+
>
171+
Provide feedback here
167172
</a>
168173
</div>
169174
<div className="bg-sidebar-accent p-4 rounded-md text-sm text-foreground">
170175
<span className="font-bold">Need Support?</span>
171176
<br />
172-
<a href="#" target="_blank" rel="noopener noreferrer" className="underline text-foreground">
177+
<a
178+
href="https://oasis.io/discord"
179+
target="_blank"
180+
rel="noopener noreferrer"
181+
className="underline text-foreground"
182+
>
173183
Speak to our devs.
174184
</a>
175185
</div>

src/components/MetadataFormFields/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ type MetadataFormFieldsProps = {
1010
export const MetadataFormFields: FC<MetadataFormFieldsProps> = ({ control }) => {
1111
return (
1212
<div className="space-y-6">
13-
<InputFormField control={control} name="name" label="Name" placeholder="ROFL App name" />
13+
<InputFormField control={control} name="name" label="Name" placeholder="App name" />
1414

15-
<InputFormField control={control} name="author" label="Author" placeholder="Rofl App Creator" />
15+
<InputFormField control={control} name="author" label="Author" placeholder="App Creator" />
1616

1717
<InputFormField
1818
control={control}
@@ -22,9 +22,9 @@ export const MetadataFormFields: FC<MetadataFormFieldsProps> = ({ control }) =>
2222
type="textarea"
2323
/>
2424

25-
<InputFormField control={control} name="version" label="Version" placeholder="Rofl App version" />
25+
<InputFormField control={control} name="version" label="Version" placeholder="App version" />
2626

27-
<InputFormField control={control} name="license" label="license" placeholder="MIT, Apache-2.0, etc." />
27+
<InputFormField control={control} name="license" label="License" placeholder="MIT, Apache-2.0, etc." />
2828

2929
<InputFormField
3030
control={control}

src/nexus/generated/api.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,8 +2519,23 @@ export type GetRuntimeRoflAppsParams = {
25192519
* A filter on the name of the ROFL app. If multiple names are provided, the ROFL App must match all of them.
25202520
*/
25212521
name?: string[]
2522+
/**
2523+
* The field to sort the ROFL apps by.
2524+
If unset, the ROFL apps will be sorted by activity (num_active_instances, num_transactions) in descending order.
2525+
To sort by creation time, set this to `created_at` (or `created_at_desc`).
2526+
2527+
*/
2528+
sort_by?: GetRuntimeRoflAppsSortBy
25222529
}
25232530

2531+
export type GetRuntimeRoflAppsSortBy =
2532+
(typeof GetRuntimeRoflAppsSortBy)[keyof typeof GetRuntimeRoflAppsSortBy]
2533+
2534+
export const GetRuntimeRoflAppsSortBy = {
2535+
created_at: 'created_at',
2536+
created_at_desc: 'created_at_desc',
2537+
} as const
2538+
25242539
export type GetRuntimeRoflAppsIdTransactionsParams = {
25252540
/**
25262541
* The maximum numbers of items to return.

src/pages/CreateApp/AgentStepHints.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,15 @@ export const AgentStepHints: FC<AgentStepHintsProps> = ({ selectedTemplateId })
4747
README.MD
4848
</Button>
4949
</DialogTrigger>
50-
<DialogContent className="sm:max-w-3xl">
50+
<DialogContent className="sm:max-w-3xl max-h-[80vh] flex flex-col">
5151
<DialogTitle></DialogTitle>
5252
<DialogHeader>
5353
<DialogTitle>README.md</DialogTitle>
5454
<DialogDescription>Docs provided by the template authors.</DialogDescription>
5555
</DialogHeader>
56-
<ReactMarkdown>{markdown}</ReactMarkdown>
56+
<div className="flex-1 overflow-y-auto pr-2">
57+
<ReactMarkdown>{markdown}</ReactMarkdown>
58+
</div>
5759
</DialogContent>
5860
</Dialog>
5961
</>

src/pages/CreateApp/AnimatedStepText.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const textContent = {
3838
'Nulla pretium dictum metus, in fringilla arcu tincidunt ut. Duis eget turpis at magna tempor interdum at ac ante.',
3939
},
4040
success: {
41-
header: 'ROFL App will be ready in 5 minutes!',
41+
header: 'App will be ready in 5 minutes!',
4242
description: (
4343
<>
4444
<div>

src/pages/CreateApp/BuildStep.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ export const BuildStep: FC<AgentStepProps> = ({
172172
multiplyNumber={Number(form.watch('number'))}
173173
duration={form.watch('duration')}
174174
onCostCalculated={handleCostCalculated}
175+
network={network}
175176
/>
176177
))}
177178
</RadioGroup>

src/pages/CreateApp/BuildStepOffers.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type BuildStepOffersProps = {
1717
multiplyNumber?: number
1818
duration: BuildFormData['duration']
1919
onCostCalculated?: (roseCostInBaseUnits: string) => void
20+
network: 'mainnet' | 'testnet'
2021
}
2122

2223
export const BuildStepOffers: FC<BuildStepOffersProps> = ({
@@ -25,14 +26,21 @@ export const BuildStepOffers: FC<BuildStepOffersProps> = ({
2526
fieldValue,
2627
duration,
2728
onCostCalculated,
29+
network,
2830
}) => {
2931
const ticker = useTicker()
3032
const targetTerms =
3133
duration === 'months' ? oasisRT.types.RoflmarketTerm.MONTH : oasisRT.types.RoflmarketTerm.HOUR
3234
const targetTermsPrice = (offer.payment?.native as { terms?: Record<oasisRT.types.RoflmarketTerm, string> })
3335
?.terms?.[targetTerms]
3436
const multiplyBy = duration === 'days' ? multiplyNumber * 24 : multiplyNumber
35-
const { data: rosePrice, isLoading: isLoadingRosePrice, isFetched: isFetchedRosePrice } = useGetRosePrice()
37+
const {
38+
data: rosePrice,
39+
isLoading: isLoadingRosePrice,
40+
isFetched: isFetchedRosePrice,
41+
} = useGetRosePrice({
42+
enabled: network !== 'testnet',
43+
})
3644
const roseCostInBaseUnits = multiplyBaseUnits(targetTermsPrice || '0', multiplyBy)
3745
const roseCost = fromBaseUnits(roseCostInBaseUnits)
3846

0 commit comments

Comments
 (0)