Skip to content

Commit 39a4095

Browse files
committed
style the dropdown list
1 parent aaf436a commit 39a4095

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/problems-by-company/company.ts

+15-4
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ function addNavbarLinks() {
5151
button.appendChild(icon);
5252

5353
button.style.color = '#fff';
54-
button.style.minWidth = '150px';
55-
button.style.height = '50px';
54+
button.style.minWidth = '130px';
55+
button.style.height = '40px';
5656
button.style.padding = '5px';
57+
button.style.border = '3px solid #373737';
5758
button.style.backgroundColor = '#373737';
5859
button.style.borderRadius = '10px';
59-
button.style.fontSize = '15px';
60+
button.style.fontSize = '12px';
6061

6162
const companyName = document.createTextNode(`${company}`);
6263
button.appendChild(companyName);
@@ -130,6 +131,10 @@ function addCompanyProblems(sortMethod: string) {
130131
async function addCompaniesToSelect() {
131132
const companySelect = document.getElementById('companySelect') as HTMLSelectElement;
132133

134+
companySelect.style.backgroundColor = '#373737';
135+
companySelect.style.color = '#fff';
136+
companySelect.style.padding = '5px';
137+
133138
let uniqueCompanies = new Set<string>();
134139

135140
const data = await new Promise<{ leetcodeProblems: LeetcodeProblems }>(resolve => {
@@ -146,7 +151,10 @@ async function addCompaniesToSelect() {
146151
}
147152
});
148153

149-
uniqueCompanies.forEach((company) => {
154+
// Convert the Set to an Array and sort it alphabetically
155+
const sortedCompanies = Array.from(uniqueCompanies).sort();
156+
157+
sortedCompanies.forEach((company) => {
150158
const option = document.createElement('option');
151159
option.value = company;
152160
option.text = company;
@@ -161,9 +169,12 @@ async function addCompaniesToSelect() {
161169
location.reload();
162170
});
163171
});
172+
173+
companySelect.style.maxHeight = '500px';
164174
}
165175

166176

177+
167178
function sortBy(column: string) {
168179
if (column === 'Score') {
169180
solutions.sort((a, b) => b.score - a.score);

0 commit comments

Comments
 (0)