@@ -100,7 +159,7 @@ export const TabsView = ({ item, offers, needs, relations, updatePermission, loa
{item.layer?.itemType.relations &&
<>
-
updateActiveTab(7)} />
+
updateActiveTab(7)} />
diff --git a/src/Components/Templates/AttestationForm.tsx b/src/Components/Templates/AttestationForm.tsx
new file mode 100644
index 00000000..399eb9fc
--- /dev/null
+++ b/src/Components/Templates/AttestationForm.tsx
@@ -0,0 +1,108 @@
+
+import { MapOverlayPage } from './MapOverlayPage'
+import { useItems } from '../Map/hooks/useItems'
+import { useAssetApi } from '../AppShell/hooks/useAssets'
+import { EmojiPicker } from './EmojiPicker';
+import { Link, useNavigate } from 'react-router-dom';
+import { useRef, useState } from 'react';
+import { Item, ItemsApi } from '../../types';
+import { useEffect } from 'react';
+import { toast } from 'react-toastify';
+
+export const AttestationForm = ({api}:{api?:ItemsApi
}) => {
+
+ const items = useItems();
+ const assetsApi = useAssetApi();
+ const [users, setUsers] = useState>();
+ const navigate = useNavigate();
+
+ useEffect(() => {
+ let params = new URLSearchParams(location.search);
+ let to_user_ids = params.get("to");
+ setUsers(items.filter(i => to_user_ids?.includes(i.id)))
+ }, [items, location])
+
+ const [inputValue, setInputValue] = useState('');
+ const inputRef = useRef(null);
+
+ useEffect(() => {
+ if (inputRef.current) {
+ inputRef.current.style.width = 'auto';
+ inputRef.current.style.width = `${inputRef.current.scrollWidth+20}px`;
+ }
+ }, [inputValue]);
+
+ const handleChange = (event: React.ChangeEvent) => {
+ setInputValue(event.target.value);
+ };
+
+ const sendAttestation = async () => {
+ const to : Array = [];
+ users?.map(u => to.push({ directus_users_id: u.user_created.id }));
+
+
+ api?.createItem && toast.promise(
+ api.createItem({
+ text: inputValue,
+ emoji: selectedEmoji,
+ color: selectedColor,
+ shape: selectedShape,
+ to: to
+ }), {
+ pending: 'creating attestation ...',
+ success: 'Attestation created',
+ error: {
+ render({ data }) {
+ return `${data}`
+ },
+ },
+ })
+ .then( () => navigate("/item/" + items.find(i => i.user_created.id===to[0].directus_users_id && i.layer?.itemType.name==="player")?.id+"?tab=2")
+ )
+
+ }
+
+ const [selectedEmoji, setSelectedEmoji] = useState('select badge');
+ const [selectedShape, setSelectedShape] = useState('circle');
+ const [selectedColor, setSelectedColor] = useState('#fff0d6');
+
+
+ return (
+
+ Gratitude
+ to
+
+ {users && users.map((u, k) => (
+
+ {u.image ?
+
+

+
+
:
+
}
+
+
+ ), ", ")}
+
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/src/Components/Templates/EmojiPicker.tsx b/src/Components/Templates/EmojiPicker.tsx
new file mode 100644
index 00000000..4f7f7be5
--- /dev/null
+++ b/src/Components/Templates/EmojiPicker.tsx
@@ -0,0 +1,93 @@
+import { useState } from 'react';
+
+export const EmojiPicker = ({selectedEmoji, selectedColor, selectedShape, setSelectedEmoji, setSelectedColor, setSelectedShape}) => {
+
+
+
+ const [isOpen, setIsOpen] = useState(false);
+
+ const emojis = [
+ 'โค๏ธ', '๐', '๐', '๐ป',, 'โจ', 'โ๏ธ',
+ '๐ฅ', '๐ชต', '๐ง', '๐ถ', '๐จ','๐',
+ '๐', 'โ๏ธ', '๐งฉ','๐ก', '๐', '๐ฌ',
+ '๐ ', '๐ป', '๐น', '๐จ', '๐', '๐',
+ 'โฝ๏ธ', '๐งต', '๐', '๐ฑ',
+ '๐', '๐ช', '๐', '๐น',
+ '๐ฅ', '๐ฅ', '๐ฅ', '๐ฅ'];
+ const shapes = ["squircle", "circle", "hexagon-2"];
+
+ const colors = ["#FF99C8", "#fff0d6", "#FCF6BD", "#D0F4DE", "#A9DEF9", "#E4C1F9", "#de324c", "#f4895f", "#f8e16f", "#95cf92", "#369acc", "#9656a2"]
+
+
+ const toggleDropdown = () => {
+ setIsOpen(!isOpen);
+ };
+
+ const selectEmoji = (emoji) => {
+ setSelectedEmoji(emoji);
+ setIsOpen(false);
+ };
+
+ const selectShape = (shape) => {
+ setSelectedShape(shape);
+ setIsOpen(false);
+ };
+
+ const selectColor = (color) => {
+ setSelectedColor(color);
+ setIsOpen(false);
+ };
+
+
+
+ return (
+ <>
+
+ {selectedEmoji}
+
+
+ {isOpen && (
+
+
+ {emojis.map((emoji) => (
+
+ ))}
+
+
+
+ {shapes.map(shape => (
+
+ ))}
+
+
+
+ {colors.map(color => (
+
+ ))}
+
+
+
+ )}
+ >
+ );
+};
+
diff --git a/src/Components/Templates/SelectUser.tsx b/src/Components/Templates/SelectUser.tsx
new file mode 100644
index 00000000..c43d62bb
--- /dev/null
+++ b/src/Components/Templates/SelectUser.tsx
@@ -0,0 +1,55 @@
+import { useState } from 'react'
+import { MapOverlayPage } from './MapOverlayPage'
+import { useItems } from '../Map/hooks/useItems'
+import { useAssetApi } from '../AppShell/hooks/useAssets'
+import { Link } from 'react-router-dom'
+
+export const SelectUser = ({ userType }: { userType: string }) => {
+
+ const items = useItems();
+ const users = items.filter(i => i.layer?.itemType.name == userType)
+ const assetsApi = useAssetApi();
+
+ const [selectedUsers, setSelectedUsers] = useState>([]);
+
+ return (
+
+
+ Gratitude to ...
+
+
+ {/* Team Member list in table format loaded constant */}
+
+
+
+ {
+ users.map((u, k) => {
+ return (
+
+ |
+ setSelectedUsers(prev => [...prev, u.id])} className="tw-checkbox tw-checkbox-sm" />
+ |
+
+
+ {u.image ?
+
+ 
+
+ :
+ }
+
+
+ |
+
+ )
+ })
+ }
+
+
+
+ u,",")}>
+
+ )
+}
\ No newline at end of file
diff --git a/src/Components/Templates/index.tsx b/src/Components/Templates/index.tsx
index bd2720a6..cbb8fd57 100644
--- a/src/Components/Templates/index.tsx
+++ b/src/Components/Templates/index.tsx
@@ -1,5 +1,9 @@
+import { AttestationForm } from './AttestationForm'
+
export {CardPage} from './CardPage'
export {TitleCard} from './TitleCard'
export {MapOverlayPage} from './MapOverlayPage'
export {MoonCalendar} from './MoonCalendar'
-export {OverlayItemsIndexPage} from "./OverlayItemsIndexPage"
\ No newline at end of file
+export {SelectUser} from "./SelectUser"
+export {OverlayItemsIndexPage} from "./OverlayItemsIndexPage"
+export {AttestationForm} from "./AttestationForm"
diff --git a/src/index.css b/src/index.css
index 9fae544a..0790b43c 100644
--- a/src/index.css
+++ b/src/index.css
@@ -52,6 +52,10 @@
}
+.placeholder-center::placeholder {
+ text-align: center;
+}
+
.custom-file-upload {
cursor: pointer;
}
diff --git a/src/index.tsx b/src/index.tsx
index 7afe478e..2137b4dc 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -3,7 +3,7 @@ export {AppShell, Content, SideBar, Sitemap } from "./Components/AppShell"
export {AuthProvider, useAuth, LoginPage, SignupPage, RequestPasswordPage, SetNewPasswordPage} from "./Components/Auth"
export {UserSettings, ProfileView, ProfileForm} from './Components/Profile'
export {Quests, Modal} from './Components/Gaming'
-export {TitleCard, CardPage, MapOverlayPage, OverlayItemsIndexPage, MoonCalendar } from './Components/Templates'
+export {TitleCard, CardPage, MapOverlayPage, OverlayItemsIndexPage, MoonCalendar, SelectUser, AttestationForm } from './Components/Templates'
export {TextInput, TextAreaInput, SelectBox} from './Components/Input'
import "./index.css"
diff --git a/tailwind.config.js b/tailwind.config.js
index 58613143..79de417a 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -4,6 +4,25 @@ module.exports = {
"./src/**/*.{js,jsx,ts,tsx}",
"./node_modules/tw-elements/dist/js/**/*.js"
],
+ safelist: [
+ 'tw-mask-squircle',
+ 'tw-mask-circle',
+ 'tw-mask-hexagon-2',
+ 'tw-mask-decagon',
+ 'tw-bg-[#FF99C8]',
+ 'tw-bg-[#fff0d6]',
+ 'tw-bg-[#FCF6BD]',
+ 'tw-bg-[#D0F4DE]',
+ 'tw-bg-[#A9DEF9]',
+ 'tw-bg-[#E4C1F9]',
+ 'tw-bg-[#de324c]',
+ 'tw-bg-[#f4895f]',
+ 'tw-bg-[#f8e16f]',
+ 'tw-bg-[#95cf92]',
+ 'tw-bg-[#369acc]',
+ 'tw-bg-[#9656a2]',
+
+ ],
theme: {
extend: {
zIndex: {
@@ -31,7 +50,7 @@ module.exports = {
'sans': ["Helvetica", "sans-serif", 'Roboto'],
},
fontSize: {
- 'map': "13px"
+ 'map': "13px"
},
lineHeight: {
'map': "1.4em"
@@ -54,17 +73,18 @@ module.exports = {
],
daisyui: {
themes: ["light", "dark", "cupcake", "retro", "cyberpunk", "aqua",
- {
- docutopia: {
- "primary": "#8e00ff",
- "secondary": "#00bb7a",
- "accent": "#006aff",
- "neutral": "#231502",
- "base-content": "#ffad6b",
- "base-100": "#440844",
- },
- },]
+ {
+ docutopia: {
+ "primary": "#8e00ff",
+ "secondary": "#00bb7a",
+ "accent": "#006aff",
+ "neutral": "#231502",
+ "base-content": "#ffad6b",
+ "base-100": "#440844",
+ },
+ },]
},
prefix: 'tw-',
content: ['./src/**/*.{js,jsx,ts,tsx}'],
-}
+
+}
\ No newline at end of file