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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added setting for change avatar border color #45

Merged
merged 3 commits into from
Oct 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 6 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
## Please create the pull request to **[dev](https://github.com/RizkyRajitha/linkin/tree/dev) branch** branch.
## Contributing Guidelines pull request [Making a pull request](https://github.com/RizkyRajitha/linkin/blob/master/CONTRIBUTING.md#making-pull-request)
<!-- ## Please create the pull request to **[dev](https://github.com/RizkyRajitha/linkin/tree/dev) branch** branch. -->

### Guidelines

- I read the [Contributing Guidelines](https://github.com/CONTRIBUTING.md) [ ]
- [ ] I read the [Contributing Guidelines](https://github.com/CONTRIBUTING.md)

### This pull request regarding on

- [ ] issue
- [ ] feature request
- [ ] bug
- [ ] fixed an issue
- [ ] developed new feature
- [ ] fixed a bug

### Briefly describe what you did

Expand Down
15 changes: 15 additions & 0 deletions components/colorform.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const ColorForm = ({ data, update, loading }) => {
handlerFontColor: data.handlerFontColor,
footerBgColor: data.footerBgColor,
footerTextColor: data.footerTextColor,
avatarBorderColor: data.avatarBorderColor,
handlerDescriptionFontColor: data.handlerDescriptionFontColor,
},
});
Expand Down Expand Up @@ -97,6 +98,20 @@ const ColorForm = ({ data, update, loading }) => {
</div>
</div>

<div className="row">
<div className="col">
<div className="mb-3 ">
<label className="form-label">Avatar Border color </label>
<input
type="color"
className="form-control form-control-color"
title="Choose Avatar Border color"
{...register("avatarBorderColor")}
/>
</div>{" "}
</div>
</div>

<button
type="submit"
className="btn btn-primary btn-block"
Expand Down
4 changes: 3 additions & 1 deletion components/linkinthebiopage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default function Home({
avatarUrl,
accentColor,
avatarwidth,
avatarBorderColor,
handlerFontSize,
handlerFontColor,
fontFamily,
Expand All @@ -25,6 +26,7 @@ export default function Home({
}) {
accentColor = isEmpty(accentColor) ? "#BDD7FF" : accentColor;
avatarwidth = isEmpty(avatarwidth) ? "50" : avatarwidth;
avatarBorderColor = isEmpty(avatarBorderColor) ? "#fff" : avatarBorderColor;
handlerFontSize = isEmpty(handlerFontSize) ? "15" : handlerFontSize;
handlerFontColor = isEmpty(handlerFontColor) ? "#fff" : handlerFontColor;
bgColor = isEmpty(bgColor) ? "#fff" : bgColor;
Expand Down Expand Up @@ -171,7 +173,7 @@ export default function Home({
border-radius: 50%;
width: ${avatarwidth}%;
padding: 4px;
background: #fff;
background: ${avatarBorderColor};
}

.handlerText {
Expand Down
1 change: 1 addition & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ model pagedata {
avatarUrl String? @db.VarChar
avatarheight String? @db.VarChar
avatarwidth String? @db.VarChar
avatarBorderColor String? @db.VarChar
bgColor String? @db.VarChar
accentColor String? @db.VarChar
handlerText String? @db.VarChar
Expand Down
1 change: 1 addition & 0 deletions scripts/seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ async function seed() {
handlerText: "LinkIn",
avatarUrl:
"https://res.cloudinary.com/dijjqfsto/image/upload/v1621666671/linkin_logo_1_jcuvr3.png",
avatarBorderColor: "#ffffff",
bgColor: "#7ea2ff",
accentColor: "#bdd7ff",
handlerFontSize: "20",
Expand Down