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

fix: handled style change in ServerUrl and ServersOverlay dynamically #1989

Merged
merged 3 commits into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 3 additions & 3 deletions src/components/Endpoint/styled.elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export const ServersOverlay = styled.div<{ expanded: boolean }>`
position: absolute;
width: 100%;
z-index: 100;
background: #fafafa;
color: #263238;
background: ${props => props.theme.rightPanel.servers.overlay.backgroundColor};
color: ${props => props.theme.rightPanel.servers.overlay.textColor};
box-sizing: border-box;
box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.33);
overflow: hidden;
Expand All @@ -78,7 +78,7 @@ export const ServerItem = styled.div`
export const ServerUrl = styled.div`
padding: 5px;
border: 1px solid #ccc;
background: #fff;
background: ${props => props.theme.rightPanel.servers.url.backgroundColor};
word-break: break-all;
color: ${props => props.theme.colors.primary.main};
> span {
Expand Down
20 changes: 20 additions & 0 deletions src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,15 @@ const defaultTheme: ThemeInterface = {
backgroundColor: '#263238',
width: '40%',
textColor: '#ffffff',
servers: {
overlay: {
backgroundColor: '#fafafa',
textColor: '#263238',
},
url: {
backgroundColor: '#fff',
},
},
},
codeBlock: {
backgroundColor: ({ rightPanel }) => darken(0.1, rightPanel.backgroundColor),
Expand Down Expand Up @@ -229,6 +238,16 @@ export interface FontSettings {
color: string;
}

export interface Servers {
overlay: {
backgroundColor: string;
textColor: string;
};
url: {
backgroundColor: string;
};
}

export interface ResolvedThemeInterface {
spacing: {
unit: number;
Expand Down Expand Up @@ -346,6 +365,7 @@ export interface ResolvedThemeInterface {
backgroundColor: string;
textColor: string;
width: string;
servers: Servers;
};
codeBlock: {
backgroundColor: string;
Expand Down