Skip to content

Commit

Permalink
Fix CSS styles and update manifest version
Browse files Browse the repository at this point in the history
  • Loading branch information
keybraker committed Nov 26, 2023
1 parent ef4e2a9 commit 3d9082d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 19 deletions.
3 changes: 0 additions & 3 deletions src/css/flaggerToggle.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@


.flagger-toggle-product {
display: flex;
align-items: center;
justify-content: center;
margin: 8px 16px 16px 0px !important;
padding: 9px 17px !important;
display: flex !important;
Expand Down
18 changes: 9 additions & 9 deletions src/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

.align-end {
text-align: end !important;
/* font-style: italic !important; */
}

text-black {
Expand All @@ -46,8 +45,9 @@ text-black {
.sponsored-label,
.flagged-list-title,
.label-text {
border-radius: 5px !important;
padding: 2px 6px 2px !important;
border-radius: 2px !important;
padding: 8px 12px !important;

background-color: #ffdbdf !important;
font-weight: bold !important;
color: red !important;
Expand All @@ -60,21 +60,21 @@ text-black {
}

.info-label-positive {
border: 1px solid var(--color-text-success-default) !important; /* Updated to use variable */
border: 1px solid var(--color-text-success-default) !important;
line-height: 1.4 !important;
font-size: 16px !important;
font-weight: 500 !important;
background-color: var(--color-background-success-weak) !important; /* Updated to use variable */
color: var(--color-text-success-default) !important; /* Updated to use variable */
background-color: var(--color-background-success-weak) !important;
color: var(--color-text-success-default) !important;
}

.info-label-negative {
border: 1px solid var(--custom-light-red, #ff0000) !important; /* Existing implementation */
border: 1px solid var(--custom-light-red, #ff0000) !important;
line-height: 1.4 !important;
font-size: 16px !important;
font-weight: 500 !important;
background-color: var(--color-background-accent-weak) !important; /* Matches existing color */
color: var(--color-text-accent-default) !important; /* Matches existing color */
background-color: var(--color-background-accent-weak) !important;
color: var(--color-text-accent-default) !important;
}

.sponsored-label svg,
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/sponsoredProductHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ export class SponsoredProductHandler {

private hasSponsoredLabelText(listItem: Element): boolean {
const labelTextElement = listItem.querySelector(".label-text");
return !!labelTextElement && isSponsored(labelTextElement);
return isSponsored(labelTextElement);
}

private hasFlaggedLabelText(listItem: Element): boolean {
const labelTextElement = listItem.querySelector(".label-text");
return !!labelTextElement && isFlagged(labelTextElement);
return isFlagged(labelTextElement);
}
}
2 changes: 1 addition & 1 deletion src/manifest_chrome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Skroutz Sponsored Flagger",
"description": "Flags sponsored products on Skroutz.gr",
"version": "1.5.6",
"version": "1.5.7",
"manifest_version": 3,
"permissions": [],
"content_scripts": [
Expand Down
2 changes: 1 addition & 1 deletion src/manifest_firefox.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Skroutz Sponsored Flagger",
"description": "Flags sponsored products on Skroutz.gr",
"version": "1.5.6",
"version": "1.5.7",
"manifest_version": 3,
"permissions": [],
"content_scripts": [
Expand Down
7 changes: 4 additions & 3 deletions src/utilities/sponsoredUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export function updateSponsoredTextSingle(
}
}

export function isSponsored(element: Element | null) {
if (!element || !element?.textContent) {
export function isSponsored(element: Element | null): boolean {
if (!element || !element.textContent) {
return false;
}

Expand All @@ -64,5 +64,6 @@ export function isSponsored(element: Element | null) {
"Sponsored",
];

return sponsoredTexts.includes(element.textContent);
return sponsoredTexts.includes(element.textContent.trim());
}

0 comments on commit 3d9082d

Please sign in to comment.