Skip to content

Commit

Permalink
feat(app): allow customization of scorer panel text (#2366)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianHymer authored Apr 2, 2024
1 parent 1f7edd1 commit cfa4de9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/components/DashboardScorePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const ScoreRing = ({ className }: { className: string }) => {
export const DashboardScorePanel = ({ className }: { className: string }) => {
const customization = useCustomization();
const customTitle = isDynamicCustomization(customization) ? customization.scorerPanel?.title : undefined;
const customText = isDynamicCustomization(customization) ? customization.scorerPanel?.text : undefined;

return (
<div
Expand All @@ -115,9 +116,9 @@ export const DashboardScorePanel = ({ className }: { className: string }) => {
<ScoreRing className="shrink-0" />
<div className="mx-6 h-3/4 w-[2px] shrink-0 bg-gradient-to-t from-background-4 via-foreground-2 to-background-4" />
<p className="shrink">
Your {customTitle || "Unique Humanity Score"} is based out of 100 and measures your uniqueness. The current
passing threshold is 20. Scores may vary across different apps, especially due to abuse or attacks on the
service.
{customText ||
"Your Unique Humanity Score is based out of 100 and measures your uniqueness. The current passing threshold is 20. " +
"Scores may vary across different apps, especially due to abuse or attacks on the service."}
</p>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions app/utils/customizationUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export type DynamicCustomization = BasicCustomization & {
};
scorerPanel?: {
title?: string;
text?: string;
};
dashboardPanel: {
logo: {
Expand Down Expand Up @@ -64,6 +65,7 @@ type CustomizationResponse = {
};
scorerPanel?: {
title?: string;
text?: string;
};
dashboardPanel?: {
logo?: {
Expand Down Expand Up @@ -108,6 +110,7 @@ export const requestDynamicCustomizationConfig = async (
},
scorerPanel: {
title: customizationResponse.scorerPanel?.title,
text: customizationResponse.scorerPanel?.text,
},
dashboardPanel: {
logo: {
Expand Down

0 comments on commit cfa4de9

Please sign in to comment.