fix mobile view for index manager

This commit is contained in:
PhilReact 2025-04-05 03:40:01 +03:00
parent 7a33cc7f65
commit 85a987cbd3
4 changed files with 29 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "qapp-core",
"version": "1.0.13",
"version": "1.0.14",
"description": "Qortal's core React library with global state, UI components, and utilities",
"main": "dist/index.js",
"module": "dist/index.mjs",

View File

@ -567,7 +567,11 @@ const CreateIndex = ({
const identifier = `idx-${hashedRootName}-${hashedLink}-`;
const res = await fetch(`/arbitrary/indices/${nameParam}/${identifier}`)
const data = await res.json()
setRecommendedIndices(data)
const uniqueByTerm = data.filter(
(item: any, index: number, self: any) =>
index === self.findIndex((t: any) => t.term === item.term)
);
setRecommendedIndices(uniqueByTerm)
} catch (error) {
}
@ -656,7 +660,9 @@ const CreateIndex = ({
<Box>
<Box sx={{
width: '100%'
}}>
<RadioGroup
aria-labelledby="demo-controlled-radio-buttons-group"
name="controlled-radio-buttons-group"
@ -809,6 +815,7 @@ const YourIndices = ({
const identifier = `idx-${hashedRootName}-${hashedLink}-`;
const res = await fetch(`/arbitrary/indices/${nameParam}/${identifier}`)
const data = await res.json()
setRecommendedIndices(data)
} catch (error) {
@ -898,7 +905,9 @@ const YourIndices = ({
<Box>
<Box sx={{
width: '100%'
}}>
<RadioGroup
aria-labelledby="demo-controlled-radio-buttons-group"
name="controlled-radio-buttons-group"

View File

@ -1,6 +1,7 @@
export { useResourceStatus } from './hooks/useResourceStatus';
export { Spacer } from './common/Spacer';
import './index.css'
export { createQortalLink } from './utils/qortal';
export { IndexCategory } from './state/indexes';
export { hashWordWithoutPublicSalt } from './utils/encryption';
export { createAvatarLink } from './utils/qortal';

View File

@ -1,3 +1,17 @@
export const createAvatarLink = (qortalName: string)=> {
return `/arbitrary/THUMBNAIL/${encodeURIComponent(qortalName)}/qortal_avatar?async=true`
}
const removeTrailingSlash = (str: string) => str.replace(/\/$/, '');
export const createQortalLink = (type: 'APP' | 'WEBSITE', appName: string, path: string) => {
let link = 'qortal://' + type + '/' + appName
if(path && path.startsWith('/')){
link = link + removeTrailingSlash(path)
}
if(path && !path.startsWith('/')){
link = link + '/' + removeTrailingSlash(path)
}
return link
};