Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New version #2

Open
wants to merge 250 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
250 commits
Select commit Hold shift + click to select a range
3537f03
added config type
agustinkassis Mar 2, 2023
8f8e5cd
implemented config titles
agustinkassis Mar 2, 2023
b02c864
Update with my data
rapax00 Mar 6, 2023
5b4852a
Update with my data
rapax00 Mar 6, 2023
2942795
Fixed
rapax00 Mar 6, 2023
a2957d5
My photo
rapax00 Mar 6, 2023
c5a3c65
Update with my photo
rapax00 Mar 6, 2023
886a632
Fixed link Github
rapax00 Mar 6, 2023
c1d3b5b
refactored profile picture
agustinkassis Mar 6, 2023
8bc3e7a
added version
agustinkassis Mar 6, 2023
efa99a5
Merge branch 'main' into main
agustinkassis Mar 6, 2023
6f29260
revert rapax merge
agustinkassis Mar 6, 2023
8f9d179
updated README
agustinkassis Mar 6, 2023
25fc936
removed rapax picture
agustinkassis Mar 6, 2023
173036c
added option version field on config
agustinkassis Mar 6, 2023
bca199d
refactored config system
agustinkassis Mar 6, 2023
1dd3ffe
Create .nojekyll
agustinkassis Mar 7, 2023
f0b24b8
bump yarn version 3
agustinkassis Mar 15, 2023
02a2628
refactored config.yml
agustinkassis Mar 15, 2023
2ff6cbb
Merge branch 'main' of https://github.com/lacrypta/links
agustinkassis Mar 15, 2023
7d2521b
revemod config hooks
agustinkassis Mar 16, 2023
597435f
added yarn version
agustinkassis Mar 16, 2023
2d1b347
added config type github
agustinkassis Mar 16, 2023
9e42035
refactored config
agustinkassis Mar 16, 2023
726abdc
Merge branch 'main' into yaml
agustinkassis Mar 16, 2023
99b823a
Merge pull request #6 from lacrypta/yaml
agustinkassis Mar 16, 2023
f6855fa
removed yarn 3 dependency
agustinkassis Mar 16, 2023
a4ca418
updated yarn.lock
agustinkassis Mar 16, 2023
34cd341
fixed .gitignore
agustinkassis Mar 16, 2023
46f5308
tidy package.json
agustinkassis Mar 16, 2023
206eb45
set version v18.13.0 for .nvmrc
agustinkassis Mar 16, 2023
d18ee0a
added engine on package.json
agustinkassis Mar 16, 2023
c5331c1
limited path
agustinkassis Mar 16, 2023
6602025
fixed engine
agustinkassis Mar 16, 2023
21df68b
added DOMAIN_MATCH on .env
agustinkassis Mar 16, 2023
ae86f00
ignore .env
agustinkassis Mar 16, 2023
74041ec
moved config
agustinkassis Mar 16, 2023
2be8be6
error handling
agustinkassis Mar 16, 2023
60e2b95
config refactored
agustinkassis Mar 16, 2023
38bec22
looks for repo .hodl.ar
agustinkassis Mar 16, 2023
e50b31b
bump version
agustinkassis Mar 16, 2023
980c153
Merge pull request #7 from lacrypta/fix-500
agustinkassis Mar 16, 2023
e11af80
refactored blocks
agustinkassis Mar 16, 2023
380948e
refactored locations
agustinkassis Mar 16, 2023
f695c13
Merge pull request #8 from lacrypta/refactoring
agustinkassis Mar 16, 2023
a81414c
read local config when null
agustinkassis Mar 16, 2023
1dfe342
encapsulate error
agustinkassis Mar 16, 2023
7af74f5
bump yarn version
agustinkassis Mar 16, 2023
c71876b
bump yarn version
agustinkassis Mar 16, 2023
7193420
fixed yarn config
agustinkassis Mar 16, 2023
ec2c088
added picture type
agustinkassis Mar 18, 2023
1d768e6
updated config
agustinkassis Mar 18, 2023
289ec71
added picture url
agustinkassis Mar 18, 2023
ab34d44
bump version to 0.3.2
agustinkassis Mar 18, 2023
871c7f4
removed unused config
agustinkassis Mar 18, 2023
91b082c
added google tanalytics to config
agustinkassis Mar 18, 2023
461d338
bump version
agustinkassis Mar 18, 2023
87fe8fe
removed wanna participate
agustinkassis Mar 18, 2023
af3ccc9
removed Config dependency
agustinkassis Mar 18, 2023
adde216
removed .nokyll
agustinkassis Mar 18, 2023
e6d0ea7
clean TagManagerArgs
agustinkassis Mar 18, 2023
2991fbe
cleaner code
agustinkassis Mar 18, 2023
aa3d2d6
added framer-motion
agustinkassis Mar 18, 2023
132f843
added animatino
agustinkassis Mar 18, 2023
de526e3
links animations
agustinkassis Mar 18, 2023
f7258f4
fixed google analytics
agustinkassis Mar 18, 2023
e337d72
added github lib
agustinkassis Mar 18, 2023
dd6f9c0
get github profile when no picture provided
agustinkassis Mar 18, 2023
b3560d4
added tailwind-styled-components
agustinkassis Mar 19, 2023
24d1c5d
added custom theme
agustinkassis Mar 19, 2023
03248d3
added theme types
agustinkassis Mar 19, 2023
896b938
updated config types
agustinkassis Mar 19, 2023
8ca0ff8
updated config sample
agustinkassis Mar 19, 2023
8f6f7af
added theme provider
agustinkassis Mar 19, 2023
cff7a6d
added container theme background
agustinkassis Mar 19, 2023
e871268
footer correction
agustinkassis Mar 19, 2023
f29ace5
added Cover
agustinkassis Mar 19, 2023
6693d62
aesthetics
agustinkassis Mar 19, 2023
4d2e537
logo animation
agustinkassis Mar 19, 2023
2fe309c
smoother animation
agustinkassis Mar 19, 2023
3ee6095
added blocks animation
agustinkassis Mar 19, 2023
74b6ef6
accurate cover animation
agustinkassis Mar 19, 2023
b24a0cb
added cover_color
agustinkassis Mar 19, 2023
66c4d15
bump version 0.3.5
agustinkassis Mar 19, 2023
820d51a
moved container
agustinkassis Mar 19, 2023
674fc34
added menu button
agustinkassis Mar 20, 2023
4458950
Update config.yml
agustinkassis Mar 28, 2023
9dafa89
Update config.yml
agustinkassis Mar 28, 2023
1a3b96e
fixed link description
agustinkassis Apr 1, 2023
74d41b9
added NOSTR settings
agustinkassis Apr 1, 2023
8a93c74
Merge branch 'main' of https://github.com/lacrypta/links
agustinkassis Apr 2, 2023
037b916
added theme in config
agustinkassis Apr 2, 2023
bf594dc
fixed theme error
agustinkassis Apr 2, 2023
518ae0d
updated config sample comments
agustinkassis Apr 2, 2023
3a661e4
updated config
agustinkassis Apr 3, 2023
8b558af
added webln support
agustinkassis Apr 3, 2023
99c0831
Fix and reorder links
rapax00 Apr 3, 2023
5a1520e
bump config version
agustinkassis Apr 4, 2023
f8a5a93
Update with Whatsapp
rapax00 Apr 5, 2023
3ce0ff5
hide button
agustinkassis Apr 5, 2023
50acec9
typo fix
agustinkassis Apr 5, 2023
37a783e
updated links
agustinkassis Apr 5, 2023
192c592
Merge pull request #9 from gasparrrx6/patch-1
agustinkassis Apr 6, 2023
3cc725d
Se agregó el ícono para Nostr
tincho70 Apr 12, 2023
4dcaaf5
Delete package-lock.json
agustinkassis Apr 12, 2023
6f8a7ff
added nostr to Icon type
agustinkassis Apr 12, 2023
80c6b35
Merge pull request #10 from tincho70/main
agustinkassis Apr 12, 2023
b18909c
fixed styledComponents bug
agustinkassis Apr 20, 2023
7510881
added @headlessui/react and @heroicons/react
agustinkassis Apr 20, 2023
97cb70e
added menu type
agustinkassis Apr 20, 2023
1dcc2fc
remove RoundButton from cover
agustinkassis Apr 20, 2023
b1b68e4
added MenuItems
agustinkassis Apr 20, 2023
2da001c
renamed RoundButton to MenuButton
agustinkassis Apr 20, 2023
f6c1fbd
added MenuButton to index
agustinkassis Apr 20, 2023
0860c46
added missing key to component
agustinkassis Apr 20, 2023
6165b66
changed menu icon
agustinkassis Apr 21, 2023
69a40a2
added verification modal
agustinkassis Apr 21, 2023
4a926c7
added verification context
agustinkassis Apr 21, 2023
0e989d5
wrapped app with verification provider
agustinkassis Apr 21, 2023
6931ec7
added checkmark
agustinkassis Apr 21, 2023
2b8df5b
show verification modal on click
agustinkassis Apr 21, 2023
3cfea51
aesthethic changes on verification
agustinkassis Apr 22, 2023
34a1f76
wip
agustinkassis Apr 24, 2023
a7bc2b8
wip
agustinkassis Apr 24, 2023
a3f9e22
added VERIFIED and CONFIG_FROM_PROVIDER to env
agustinkassis Apr 24, 2023
961fb35
added support for multiple config providers
agustinkassis Apr 24, 2023
dfaf7d5
added provider type
agustinkassis Apr 25, 2023
f019e70
removed raw from config
agustinkassis Apr 25, 2023
9203de2
moved config provider type to provider
agustinkassis Apr 25, 2023
5681db9
added local config provider
agustinkassis Apr 25, 2023
16f51a5
added config type to github provider
agustinkassis Apr 25, 2023
06c5d80
added provider methods to ConfigProvider context
agustinkassis Apr 25, 2023
478b60b
aethetic changes on verification components
agustinkassis Apr 25, 2023
3d0e078
set blue color for menu item
agustinkassis Apr 25, 2023
1b41ae5
using local config provider on index
agustinkassis Apr 25, 2023
00a65d7
removed invalid quotes
agustinkassis Apr 25, 2023
ce4b716
added local verification component
agustinkassis Apr 25, 2023
c4ce99f
fixed invalid eslint rule
agustinkassis Apr 25, 2023
842a086
included LocalUsernameSetup
agustinkassis Apr 25, 2023
d5acbcc
removed unused variable
agustinkassis Apr 25, 2023
6ec476a
fixed provider propagation
agustinkassis Apr 25, 2023
c1095dc
added ConfigProviderConstructor and ConfigProviderSerialized
agustinkassis Apr 25, 2023
91e0d42
refactored config providers
agustinkassis Apr 25, 2023
aab7b9f
updated env USERS_API_URL as public
agustinkassis Apr 25, 2023
a3981ee
added UserData type
agustinkassis Apr 25, 2023
cdf53d8
fixed abstract provider
agustinkassis Apr 25, 2023
fd6731f
added refresh method on config
agustinkassis Apr 25, 2023
475efe8
added createUser for hodl lib
agustinkassis Apr 25, 2023
ab4883b
updated button
agustinkassis Apr 25, 2023
6eb15c8
using NEXT_PUBLIC_USERS_API_URL
agustinkassis Apr 25, 2023
4d24ade
added wallet mock
agustinkassis Apr 25, 2023
4e4eeba
added WalletConfigStep
agustinkassis Apr 25, 2023
8eeb915
aesthetic changes for UsernameStep
agustinkassis Apr 25, 2023
e9b5234
added Spinner
agustinkassis Apr 25, 2023
9ee2e7a
implemented refresh on instructions
agustinkassis Apr 25, 2023
27f49e7
fixed html entities
agustinkassis Apr 25, 2023
3371f49
fixed linting for build
agustinkassis Apr 25, 2023
be2a677
removed webln connect
agustinkassis Apr 25, 2023
7d4ae16
added next-qrcode package
agustinkassis Apr 25, 2023
2850d14
removed username for WalletConfigStep
agustinkassis Apr 25, 2023
27a84ae
improved wallet verification widget
agustinkassis Apr 25, 2023
aee5a69
added domain redirect env
agustinkassis Apr 25, 2023
2e7e92a
use Button component
agustinkassis Apr 25, 2023
4349786
added username dependency on congratulations
agustinkassis Apr 25, 2023
23053bb
fixed env sample
agustinkassis Apr 25, 2023
71a9f1e
fixed users api endpoint
agustinkassis Apr 25, 2023
1cabde2
gets config from github
agustinkassis Apr 25, 2023
b314d71
moved verified icon
agustinkassis Apr 25, 2023
20b80f9
refactored menu items
agustinkassis Apr 26, 2023
3f5507e
added verified to config type
agustinkassis Apr 26, 2023
97e1c1c
added User type
agustinkassis Apr 26, 2023
3efcbd7
added user on config context
agustinkassis Apr 26, 2023
b2d77fb
set user on config init
agustinkassis Apr 26, 2023
ae0ce29
updated menu button draft
agustinkassis Apr 26, 2023
89ca085
added Account provider
agustinkassis Apr 26, 2023
36e8755
using same verification for next step
agustinkassis Apr 26, 2023
f35ab86
added nostr-tools and webln types
agustinkassis Apr 26, 2023
126c1e9
added nostr types
agustinkassis Apr 26, 2023
05708ca
remove log data
agustinkassis Apr 26, 2023
bd58529
added startingStep dependency on useCallback
agustinkassis Apr 26, 2023
578307b
added NostrValidate for github
agustinkassis Apr 26, 2023
2c3e1b2
added verification widgets
agustinkassis Apr 26, 2023
32ac2d3
no cache on request
agustinkassis Apr 27, 2023
d14a0b7
fixed var
agustinkassis Apr 28, 2023
25d0697
refactored steps
agustinkassis Apr 28, 2023
07cd022
moved nostr to separate step
agustinkassis Apr 28, 2023
c425c97
added disable attr to button
agustinkassis Apr 28, 2023
589072d
connect to nostr
agustinkassis Apr 28, 2023
bb3d29f
wip
agustinkassis Apr 28, 2023
afcd565
remove console log
agustinkassis May 15, 2023
2ec9027
updated request type
agustinkassis May 16, 2023
0e6ed7c
added isUsernameAvailable method
agustinkassis May 16, 2023
2c9cc47
added otToken for verification context
agustinkassis May 16, 2023
419afaf
created wallet widget draft
agustinkassis May 16, 2023
2aab42c
refactored steps
agustinkassis May 16, 2023
92f85f5
fixed congratulations
agustinkassis May 16, 2023
9afa5c6
updated button width
agustinkassis May 16, 2023
6502f51
fixed linting
agustinkassis May 16, 2023
d682089
added UserSignupStep step in flow
agustinkassis May 16, 2023
5a02511
added use-local-storage package
agustinkassis May 16, 2023
f78acc7
otToken uses local storage
agustinkassis May 16, 2023
fb71a44
add otToken on verification
agustinkassis May 16, 2023
343af6e
show draft otToken
agustinkassis May 16, 2023
748f18e
added domain redirect http
agustinkassis May 16, 2023
9a8a3c3
fixed styles
agustinkassis May 16, 2023
547fed2
redirect on user error
agustinkassis May 16, 2023
2ef3e1e
added request type
agustinkassis May 16, 2023
66f5acf
draft create wallet lib
agustinkassis May 16, 2023
f2e48cf
react-hooks/exhaustive-deps
agustinkassis May 16, 2023
bc7628d
draft flow
agustinkassis May 16, 2023
6560414
refactored nostr step
agustinkassis May 16, 2023
a93c003
add under construction alert message
agustinkassis May 17, 2023
70b1605
Merge pull request #11 from lacrypta/verification
agustinkassis May 17, 2023
5745485
added screencaps
agustinkassis May 18, 2023
6105ead
refactored env variables
agustinkassis May 18, 2023
7f58cfe
draft
agustinkassis May 18, 2023
13217e9
admin draft
agustinkassis May 19, 2023
dcb26a0
remove alert
agustinkassis May 19, 2023
eb50324
remove block
agustinkassis May 19, 2023
c23f957
renamed block
agustinkassis May 19, 2023
7becd2c
remove link
agustinkassis May 19, 2023
d8b830f
added link
agustinkassis May 19, 2023
7a690df
remove capitalize
agustinkassis May 19, 2023
55bf8fb
removed capitalize
agustinkassis May 19, 2023
382c3f6
updated request type
agustinkassis May 19, 2023
520bd94
added setupNostr method
agustinkassis May 19, 2023
e04392d
updated MenuButton
agustinkassis May 19, 2023
ada4cd9
added NostrValidate functionality
agustinkassis May 19, 2023
d80c718
fixed create wallet logic
agustinkassis May 19, 2023
09806d9
added react-hooks/exhaustive-deps
agustinkassis May 19, 2023
1565fe7
added sat.svg
agustinkassis May 20, 2023
3926731
wip
agustinkassis May 20, 2023
b234a0b
add 0 png
agustinkassis May 20, 2023
aa4edb5
demo wip
agustinkassis May 20, 2023
32a6d29
fix
agustinkassis May 20, 2023
98955ec
fixed github provider
agustinkassis May 20, 2023
eb9ad01
wip demo
agustinkassis May 20, 2023
79d1fc9
activity
agustinkassis May 20, 2023
e21c5fc
fixed milisats
agustinkassis May 20, 2023
850e21c
prevent redirect
agustinkassis May 20, 2023
74775c8
updated logo
agustinkassis Jun 5, 2023
a247b7b
added lightning icon
agustinkassis Jul 7, 2023
9914a77
added donation
agustinkassis Jul 7, 2023
25c03cd
added telegram
agustinkassis Jul 20, 2023
7256a1f
hide button
agustinkassis Jul 20, 2023
914b217
new lnurlp
rapax00 Aug 28, 2023
24a91c9
Merge pull request #12 from rapax00/patch-1
agustinkassis Aug 28, 2023
40c0d33
bump node version
agustinkassis Apr 4, 2024
2cd0f33
switch to pnpm
agustinkassis Apr 4, 2024
64fde66
updated README
agustinkassis Apr 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Url match
DOMAIN_MATCH="hodl.ar" # if hidden defaults to local config

# Config Origin
# VERIFIED=1 # for USER.hodl.ar
# CONFIG_FROM_PROVIDER=1 # for USER.PROVIDER.hodl.ar

# Endpoints
NEXT_PUBLIC_API_ENDPOINT="hodl.ar/api/users"
# NEXT_PUBLIC_DOMAIN_REDIRECT="http://localhost:3001"
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,15 @@ yarn-error.log*

# typescript
*.tsbuildinfo
next-env.d.ts

# .env
.env

# yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.11.1
873 changes: 873 additions & 0 deletions .yarn/releases/yarn-3.5.0.cjs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Create your own custom Linktr.ee like site.
- [x] Netlify Button
- [x] Vercel Button
- [x] Links config
- [ ] Title and Page config
- [ ] Editable Logo
- [x] Title and Page config
- [x] Editable Logo
- [ ] Animations on load
- [ ] Editable Background
- [ ] Editable Colors
Expand Down Expand Up @@ -82,7 +82,7 @@ Edit file in **/data/links.json**
First, run the development server:

```bash
yarn dev
pnpm dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
13 changes: 0 additions & 13 deletions components/Container.tsx

This file was deleted.

27 changes: 0 additions & 27 deletions components/Footer.tsx

This file was deleted.

18 changes: 0 additions & 18 deletions components/LinksList.tsx

This file was deleted.

17 changes: 0 additions & 17 deletions components/Logo.tsx

This file was deleted.

17 changes: 0 additions & 17 deletions components/Paper.tsx

This file was deleted.

34 changes: 34 additions & 0 deletions components/admin/Cover.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { motion } from "framer-motion";
import styled from "styled-components";

const Container = styled.div`
${(props) => `
background-color: ${props.theme.cover_color};
`}
`;

const MotionContainer = motion(Container);

interface CoverProps {
children?: React.ReactNode;
}

export const Cover = ({ children }: CoverProps) => {
return (
<MotionContainer
className='relative top-0 sm:w-[800px] sm:mx-auto sm:max-w-lg h-[54px] rounded-t-lg flex flex-row justify-between p-2 z-40'
initial={{ paddingTop: "0px", paddingBottom: "0px", maxHeight: "0px" }}
animate={{ paddingTop: "9px", paddingBottom: "9px", maxHeight: "200px" }}
transition={{
delay: 0.45,
type: "spring",
stiffness: 260,
damping: 20,
}}
>
{children}
</MotionContainer>
);
};

export default Cover;
70 changes: 70 additions & 0 deletions components/admin/MenuButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import { useEffect, useState } from "react";
import {
EllipsisVerticalIcon,
UserCircleIcon,
} from "@heroicons/react/20/solid";
import { Menu, Transition } from "@headlessui/react";

import { MenuItem as IMenuItem } from "../../types/menu";
import MenuItem from "../header/menu/MenuItem";
import { useConfig } from "../../contexts/Config";
import { useRouter } from "next/router";

interface MenuButtonProps {
className?: string;
}

export const MenuButton = ({ className }: MenuButtonProps) => {
const { config } = useConfig();
const router = useRouter();

const [menuItems, setMenuItems] = useState<IMenuItem[]>([]);

useEffect(() => {
if (typeof window === "undefined" || !config) {
return;
}
const _menuItems: IMenuItem[] = [];

_menuItems.push({
label: "Perfil",
icon: UserCircleIcon,
onClick: () => {
router.push("../");
},
});

setMenuItems(_menuItems);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [config]);

return menuItems.length > 0 ? (
<Menu as='div' className='relative inline-block text-left'>
<div>
<Menu.Button className='inline-flex w-full justify-center rounded-full bg-black/10 bg-opacity-20 p-2 text-xs font-medium hover:bg-black/25 active:bg-black/50 text-white/50 hover:text-white/75 active:text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75'>
<EllipsisVerticalIcon className='h-5 w-5' aria-hidden='true' />
</Menu.Button>
</div>
<Transition
enter='transition ease-out duration-100'
enterFrom='transform opacity-0 scale-95'
enterTo='transform opacity-100 scale-100'
leave='transition ease-in duration-75'
leaveFrom='transform opacity-100 scale-100'
leaveTo='transform opacity-0 scale-95'
>
<Menu.Items className='absolute z-50 right-0 mt-2 w-56 origin-top-right divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none'>
<div className='px-1 py-1 '>
{menuItems.map((item, k) => (
<MenuItem key={k} item={item} />
))}
</div>
</Menu.Items>
</Transition>
</Menu>
) : (
<></>
);
};

export default MenuButton;
17 changes: 17 additions & 0 deletions components/admin/Paper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { motion } from "framer-motion";

interface IPaperProps {
children?: React.ReactNode;
}

const Paper = ({ children }: IPaperProps) => {
return (
<div
className='bg-white shadow-2xl ring-1 ring-gray-900/5
relative z-20'
>
<div className='mx-auto'>{children}</div>
</div>
);
};
export default Paper;
13 changes: 13 additions & 0 deletions components/admin/PaperBody.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
interface IPaperBodyProps {
children: React.ReactNode;
}

const PaperBody = ({ children }: IPaperBodyProps) => {
return (
<div className='space-y-6 pt-4 pb-8 text-base leading-7 text-gray-600'>
{children}
</div>
);
};

export default PaperBody;
35 changes: 35 additions & 0 deletions components/admin/Profile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* eslint-disable @next/next/no-img-element */
// import next/config
import { motion } from "framer-motion";

interface ProfileProps {
title: string;
picture?: string;
}

const Profile = ({ title, picture }: ProfileProps) => {
return (
<motion.div
className='bg-white rounded-full ring-2 ring-gray-900/5
shadow-lg overflow-hidden w-[36px] h-[36px]'
initial={{ scale: 0 }}
animate={{ scale: 1 }}
transition={{
delay: 0.6,
type: "spring",
stiffness: 260,
damping: 20,
duration: 0.3,
}}
>
<img
width='140'
height='140'
alt={title}
src={picture ? picture : "/images/profile.png"}
/>
</motion.div>
);
};

export default Profile;
28 changes: 28 additions & 0 deletions components/blocks/block.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Block as IBlock } from "../../types/block";

interface BlockProps {
data: IBlock;
}

const Block = ({ data }: BlockProps) => {
data.type = data.type ? data.type : "link"; // Default
let BlockComponent;
try {
BlockComponent = require(`./${data.type}`).default;
} catch (e) {
console.error(`Block type ${data.type} not found`);
return (
<div className='text-center'>
Block type <b>{data.type}</b> not found
</div>
);
}

return (
<div className='m-1 mx-6'>
<BlockComponent data={data} />
</div>
);
};

export default Block;
14 changes: 9 additions & 5 deletions components/Link.tsx → components/blocks/link.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IconType } from "react-icons";

import { ILink, LinkType } from "../types/link";
import { Block, Icon } from "../../types/block";

// Icons
import { GrInstagram } from "react-icons/gr";
Expand All @@ -14,30 +14,34 @@ import {
} from "react-icons/bs";
import { AiOutlineLink, AiFillLinkedin } from "react-icons/ai";
import { IoMdHand } from "react-icons/io";
import { GiOstrich } from "react-icons/gi";
import { BsLightningChargeFill } from "react-icons/bs";

import TagManager from "react-gtm-module";

const socialIcon: { [key in LinkType]: IconType } = {
const socialIcon: { [key in Icon]: IconType } = {
whatsapp: BsWhatsapp,
instagram: GrInstagram,
discord: SiDiscord,
voluntary: IoMdHand,
lightning: BsLightningChargeFill,
github: BsGithub,
telegram: BsTelegram,
twitter: BsTwitter,
url: AiOutlineLink,
linkedin: AiFillLinkedin,
youtube: BsYoutube,
nostr: GiOstrich,
};

interface ILinkProps {
data: ILink;
data: Block;
}

const Link = ({ data }: ILinkProps) => {
const { title, type, url } = data;
const { title, type, icon, url } = data;

const Icon = socialIcon[type];
const Icon = socialIcon[icon];

function handleClick() {
TagManager.dataLayer({
Expand Down
Loading