Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
strseb committed Aug 21, 2024
1 parent 21c9725 commit 5fa0c27
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 25 deletions.
8 changes: 4 additions & 4 deletions src/ui/settingsPage/settingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ export class SettingsPage extends LitElement {
</main>
`;
}
removeOrigin(origin){
this.proxyHandler.then(handler => {
handler.removeContextForOrigin(origin);
})
removeOrigin(origin) {
this.proxyHandler.then((handler) => {
handler.removeContextForOrigin(origin);
});
}

static styles = css`
Expand Down
49 changes: 28 additions & 21 deletions src/ui/settingsPage/tableElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ export class ContextTable extends LitElement {
contexts: { type: Array },
sortingKey: { type: String },
sortingAcending: { type: Boolean },
onRemoveOrigin: {type: Function}
onRemoveOrigin: { type: Function },
};
constructor() {
super();
this.serverList = [];
this.contexts = [];
this.sortingKey = "origin";
this.sortingAcending = true;
this.onRemoveOrigin = ()=>{};
this.onRemoveOrigin = () => {};
}
sorters = {
origin: (a, b) => a.origin.localeCompare(b.origin),
Expand Down Expand Up @@ -61,7 +61,9 @@ export class ContextTable extends LitElement {
this.sortingAcending,
this.#setSorting.bind(this)
)}
${sortedList.map((c) => tableRow(c, this.serverList, this.onRemoveOrigin))}
${sortedList.map((c) =>
tableRow(c, this.serverList, this.onRemoveOrigin)
)}
</table>
${noElementPlaceHolder(this.contexts)}
</div>
Expand Down Expand Up @@ -170,28 +172,26 @@ export class ContextTable extends LitElement {
.tableHolder td {
padding: 16px;
}
.deleteBtn{
background-color: transparent;
color: transparent;
border: transparent;
background-image: url("../../assets/img/delete-gray.svg");
background-position: center center;
.deleteBtn {
background-color: transparent;
color: transparent;
border: transparent;
background-image: url("../../assets/img/delete-gray.svg");
background-position: center center;
background-repeat: no-repeat;
transition: ease-in-out 0.3s;
transition: ease-in-out 0.3s;
}
.deleteBtn:hover{
filter: brightness(1.5);
.deleteBtn:hover {
filter: brightness(1.5);
}
td.delete{
width: 30px;
td.delete {
width: 30px;
}
.row{
display: flex;
align-content: center;
align-items: center;
.row {
display: flex;
align-content: center;
align-items: center;
}
`;
}
customElements.define("mz-context-table", ContextTable);
Expand Down Expand Up @@ -279,7 +279,14 @@ export const tableRow = (ctx, serverList, removeOrigin) => {
</td>
<td>${name}</td>
<td class="delete">
<button class="deleteBtn" @click=${()=>{removeOrigin(ctx.origin)}}>remove</button>
<button
class="deleteBtn"
@click=${() => {
removeOrigin(ctx.origin);
}}
>
remove
</button>
</td>
</tr>
`;
Expand Down

0 comments on commit 5fa0c27

Please sign in to comment.