diff --git a/apps/profile/app/assets/warning.svg b/apps/profile/app/assets/warning.svg new file mode 100644 index 0000000000..ff110c684e --- /dev/null +++ b/apps/profile/app/assets/warning.svg @@ -0,0 +1,4 @@ + + + + diff --git a/apps/profile/app/components/accounts/SaveButton.tsx b/apps/profile/app/components/accounts/SaveButton.tsx index 6418f6da5e..1efb7ea247 100644 --- a/apps/profile/app/components/accounts/SaveButton.tsx +++ b/apps/profile/app/components/accounts/SaveButton.tsx @@ -1,6 +1,6 @@ -import { Button } from '@kubelt/design-system' +import { Button } from '@kubelt/design-system/src/atoms/buttons/Button' -const SaveButton = ({ isFormChanged, discardFn }: any) => { +const SaveButton = ({ isFormChanged, discardFn, size = 'xl' }: any) => { return ( <> {/* Form where this button is used should have @@ -19,7 +19,7 @@ const SaveButton = ({ isFormChanged, discardFn }: any) => { + + + +
+ + {props.link.name} + + {props.link.url} +
+ + {/* // Puts current link in "modification" regyme */} + + + ) +} + export default function AccountSettingsLinks() { const { notificationHandler } = useOutletContext() const transition = useTransition() const actionData = useActionData() - const [links, setLinks] = useState( - useRouteData('routes/account')?.links || [] + const sensors = useSensors( + useSensor(MouseSensor), + useSensor(TouchSensor), + useSensor(KeyboardSensor, { + coordinateGetter: sortableKeyboardCoordinates, + }) ) + const initialOldLinks = + useRouteData('routes/account')?.links || [] + + const [links, setLinks] = useState(initialOldLinks) + + const handleDragEnd = (event: any) => { + const { active, over } = event + const active_id = parseInt(active.id) + const over_id = parseInt(over.id) + + if (active_id !== over_id) { + setLinks((links) => { + const oldIndex = parseInt(active.id) + const newIndex = parseInt(over.id) + + return arrayMove(links, oldIndex, newIndex) + }) + setFormChanged(true) + } + } + const [isFormChanged, setFormChanged] = useState(false) - const initialLinks = [{ name: '', url: '', verified: false }] + const initialLinks: any[] = [] const [newLinks, setNewLinks] = useState(initialLinks) @@ -144,7 +270,6 @@ export default function AccountSettingsLinks() { > Connected Account Links -
+ {/* Links that are already in account DO */} +
+ + `${id}`)} + strategy={verticalListSortingStrategy} + > + {(links || []).map((link: any, i: number) => ( + + ))} + + +
+ {newLinks.map((link: any, i: number) => { //Check if there is an error const isError = actionData?.errors && actionData?.errors[`${i}`] @@ -174,7 +327,7 @@ export default function AccountSettingsLinks() { link.url || 'https://mywebsite.com' }-${i}`} className=" - flex flex-col w-full + flex flex-col w-full sm:flex-row sm:w-full sm:justify-start sm:items-center mb-4 py-3 px-3 truncate rounded-md border border-gray-300 " @@ -237,80 +390,26 @@ export default function AccountSettingsLinks() {
) })} - {/* Links that are already in account DO */} -
- {(links || []).map((link: any, i: number) => ( -
-
- - - - -
- - {link.name} - - {link.url} -
-
- {/* Puts current link in "modification" regyme */} - -
- ))} -
- - + Add Link + { setNewLinks(initialLinks) + setLinks(initialOldLinks) }} /> diff --git a/platform/galaxy/src/schema/resolvers/profile.ts b/platform/galaxy/src/schema/resolvers/profile.ts index bd5bbe592f..2db4be2cf3 100644 --- a/platform/galaxy/src/schema/resolvers/profile.ts +++ b/platform/galaxy/src/schema/resolvers/profile.ts @@ -38,6 +38,7 @@ const profileResolvers: Resolvers = { let accountProfile = await accountClient.getProfile.query({ account: accountURN, }) + console.log('form Profile', accountProfile) return accountProfile }, profileFromAddress: async ( @@ -50,6 +51,7 @@ const profileResolvers: Resolvers = { 'X-3RN': addressURN, }, }) + console.log('From resolver', addressURN) const accountURN = await addressClient.getAccount.query() // return the address profile if no account is associated with the address