Skip to content

Commit 72e966f

Browse files
committed
chnage linkinthebio compnenet name to linktree
1 parent 9ab93a3 commit 72e966f

File tree

5 files changed

+52
-24
lines changed

5 files changed

+52
-24
lines changed

components/linkcard.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ export default function LinkCard({
3737
reset(item);
3838
setCardInfo(item);
3939
}
40+
// logic to test comment settings data and reset
41+
// reset(item);
4042
}, [item]);
4143

4244
watch((data, { type }) => {
Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isEmpty } from "../lib/side";
1+
import { isEmpty, isHex } from "../lib/side";
22
// import Image from "next/image";
33

44
export default function Home({
@@ -27,6 +27,10 @@ export default function Home({
2727
linktreeWidth,
2828
preview = false,
2929
}) {
30+
let linkPaddingLowWidth = isEmpty(linkPadding)
31+
? "2em"
32+
: `${linkPadding * 0.5}em`;
33+
3034
accentColor = isEmpty(accentColor) ? "#BDD7FF" : accentColor;
3135
avatarwidth = isEmpty(avatarwidth) ? "50" : avatarwidth;
3236
avatarBorderColor = isEmpty(avatarBorderColor) ? "#fff" : avatarBorderColor;
@@ -38,7 +42,7 @@ export default function Home({
3842
? "https://fonts.googleapis.com/css2?family=Roboto&display=swap"
3943
: fontUrl;
4044
footerTextSize = isEmpty(footerTextSize) ? 12 : footerTextSize;
41-
footerBgColor = isEmpty(footerBgColor) ? "#000000" : footerBgColor;
45+
footerBgColor = isEmpty(footerBgColor) ? "" : footerBgColor;
4246
footerTextColor = isEmpty(footerTextColor) ? "#ffffff" : footerTextColor;
4347
linkPadding = isEmpty(linkPadding) ? "2em" : `${linkPadding}em`;
4448
linktreeWidth = isEmpty(linktreeWidth) ? "320px" : `${linktreeWidth}px`;
@@ -49,13 +53,16 @@ export default function Home({
4953
<div className="wrap">
5054
<div className="profile">
5155
{!isEmpty(avatarUrl) && <img src={avatarUrl} className="photo" />}
52-
<a
53-
className="handlerLink"
54-
href={`${handlerLink || "#"}`}
55-
target="_blank"
56-
>
57-
<span className="handlerText">{handlerText}</span>
58-
</a>
56+
<span className="handlerText">
57+
<a
58+
className="handlerLink"
59+
href={`${handlerLink || "#"}`}
60+
target="_blank"
61+
>
62+
{handlerText}{" "}
63+
</a>
64+
</span>
65+
5966
<p className="handlerDescription">{handlerDescription}</p>
6067
</div>
6168
<div className="social">
@@ -74,7 +81,9 @@ export default function Home({
7481
}}
7582
>
7683
{link.iconClass && (
77-
<i className={`${link.iconClass} single_icon fa-fw`}></i>
84+
<i
85+
className={`${link.iconClass} single_icon fa-fw`}
86+
></i>
7887
)}
7988
</a>
8089
</li>
@@ -110,13 +119,13 @@ export default function Home({
110119
</ul>
111120
</div>
112121
</div>
122+
{footerEnabled && (
123+
<div className="footer d-flex align-items-center justify-content-center">
124+
{/* Copyright © 2021 All Rights Reserved by. */}
125+
{footerText}
126+
</div>
127+
)}
113128
</div>
114-
{footerEnabled && (
115-
<div className="footer d-flex align-items-center justify-content-center">
116-
{/* Copyright © 2021 All Rights Reserved by. */}
117-
{footerText}
118-
</div>
119-
)}
120129

121130
<style
122131
jsx
@@ -130,9 +139,11 @@ export default function Home({
130139
131140
.outterwrap {
132141
margin: 0;
133-
padding: 15px;
142+
// padding: 15px;
143+
padding-top:2vh ;
134144
height: 100%;
135-
min-height: ${footerEnabled ? "96vh" : "100vh"};
145+
min-height: "100vh";
146+
// min-height: ${footerEnabled ? "96vh" : "100vh"};
136147
width: 100%;
137148
font-family: ${fontFamily};
138149
background: ${bgColor};
@@ -143,8 +154,11 @@ export default function Home({
143154
}
144155
145156
.wrap {
157+
min-height: ${footerEnabled ? "94vh" : "100vh"};
158+
height: 100%;
146159
width: 100%;
147160
max-width: ${linktreeWidth};
161+
padding: 0 1em 0 1em;
148162
margin: 0 auto;
149163
}
150164
@@ -164,7 +178,7 @@ export default function Home({
164178
}
165179
166180
.footer {
167-
position: absolute;
181+
// position: absolute;
168182
right: 0;
169183
// bottom: 0;
170184
height: 4vh;
@@ -175,7 +189,7 @@ export default function Home({
175189
text-align: center;
176190
color: ${footerTextColor};
177191
font-size: ${footerTextSize}px;
178-
width: ${preview ? "40%" : "100%"};
192+
// width: ${preview ? "40%" : "100%"};
179193
}
180194
181195
a {
@@ -206,7 +220,7 @@ export default function Home({
206220
}
207221
208222
.social {
209-
margin: 0 -2rem 0 -2rem;
223+
// margin: 0 -2rem 0 -2rem;
210224
}
211225
.social ul {
212226
list-style: none;
@@ -270,7 +284,8 @@ export default function Home({
270284
271285
@media (max-width: 768px) {
272286
.link {
273-
padding: 1.2rem;
287+
padding : ${linkPaddingLowWidth};
288+
// padding: 1.2rem;
274289
}
275290
`}</style>
276291
</div>

lib/side.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,14 @@ export function isEmpty(value) {
44
}
55
return false;
66
}
7+
8+
export function isHex(value) {
9+
if (isEmpty(value)) {
10+
return false;
11+
}
12+
13+
if (String(value).startsWith("#")) {
14+
return true;
15+
}
16+
return false;
17+
}

pages/dashboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Head from "next/head";
33

44
import { getPageDatawLinkAndSocialData } from "../lib/dbfuncprisma";
55
import { cookieValidate } from "../middleware/middleware";
6-
import Home from "../components/linkinthebiopage";
6+
import Home from "../components/linktree";
77
import Formwrapper from "../components/formwrapper";
88
import { useStateValue } from "../components/context/state";
99

pages/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Head from "next/head";
2-
import LinkinTheBioPage from "../components/linkinthebiopage";
2+
import LinkinTheBioPage from "../components/linktree";
33
import { getPageDatawLinkAndSocialData } from "../lib/dbfuncprisma";
44

55
export async function getServerSideProps() {

0 commit comments

Comments
 (0)