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

feat: add and return spaces's colors from skins table #971

Merged
merged 5 commits into from
Jan 29, 2025

Conversation

wa0x6e
Copy link
Contributor

@wa0x6e wa0x6e commented Jan 10, 2025

Toward https://github.com/snapshot-labs/workflow/issues/275

This PR adds a new table to hold a space's skin custom colors.

Context

Instead of having each space use a pre-defined skin, we're moving to each space having its own skin. This allow each space to customize its own skin, directly via its space settings

Create table with

CREATE TABLE skins (
  id VARCHAR(100) NOT NULL,
  bg_color VARCHAR(6) DEFAULT NULL,
  link_color VARCHAR(6) DEFAULT NULL,
  text_color VARCHAR(6) DEFAULT NULL,
  content_color VARCHAR(6) DEFAULT NULL,
  border_color VARCHAR(6) DEFAULT NULL,
  heading_color VARCHAR(6) DEFAULT NULL,
  primary_color VARCHAR(6) DEFAULT NULL,
  header_color VARCHAR(6) DEFAULT NULL,
  PRIMARY KEY (id)
);

@wa0x6e wa0x6e force-pushed the feat-refactor-skins branch from d0085e5 to f14e147 Compare January 10, 2025 21:43
@wa0x6e wa0x6e force-pushed the feat-refactor-skins branch from f14e147 to ef0aa8a Compare January 10, 2025 21:50
@wa0x6e wa0x6e changed the title feat: add skins table feat: add and return spaces's colors from skins table Jan 10, 2025
Copy link

codecov bot commented Jan 13, 2025

Codecov Report

Attention: Patch coverage is 0% with 67 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/graphql/helpers.ts 0.00% 42 Missing ⚠️
src/graphql/operations/follows.ts 0.00% 5 Missing ⚠️
src/graphql/operations/proposal.ts 0.00% 5 Missing ⚠️
src/graphql/operations/proposals.ts 0.00% 5 Missing ⚠️
src/graphql/operations/subscriptions.ts 0.00% 5 Missing ⚠️
src/graphql/operations/votes.ts 0.00% 5 Missing ⚠️
Additional details and impacted files

📢 Thoughts on this report? Let us know!

@wa0x6e wa0x6e requested a review from ChaituVR January 27, 2025 17:56
Copy link
Member

@ChaituVR ChaituVR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tAck

return spaces.map(space =>
Object.assign(
space,
formatSpace({ skinSettings: formatSkinSettings(space), ...space })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if it is good to call formatSkinSettings on every formatSpace, you see some alternative?

could we call formatSkinSettings inside formatSpace? maybe we can add skinsettings inside settings object 🤔

But yea not too important

@wa0x6e wa0x6e merged commit 41c97f5 into master Jan 29, 2025
2 checks passed
@wa0x6e wa0x6e deleted the feat-refactor-skins branch January 29, 2025 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants