fix: add build status favicons based on system theme (#10089)

This commit is contained in:
Kyle Carberry 2023-10-05 17:23:11 -05:00 committed by GitHub
parent f270d9d351
commit fa0a597530
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 26 additions and 2 deletions

View File

@ -98,6 +98,14 @@ export const WorkspaceReadyPage = ({
...templateVersion(workspace.template_active_version_id),
enabled: workspace.outdated,
});
const systemTheme = useState(() => {
if (typeof window.matchMedia === "undefined") {
// Default to dark mode!
return "dark";
}
const isDark = window.matchMedia("(prefers-color-scheme: dark)");
return isDark ? "dark" : "light";
});
const buildLogs = useWorkspaceBuildLogs(workspace.latest_build.id);
const shouldDisplayBuildLogs =
@ -124,12 +132,12 @@ export const WorkspaceReadyPage = ({
<link
rel="alternate icon"
type="image/png"
href={`/favicons/${favicon}.png`}
href={`/favicons/${favicon}-${systemTheme}.png`}
/>
<link
rel="icon"
type="image/svg+xml"
href={`/favicons/${favicon}.svg`}
href={`/favicons/${favicon}-${systemTheme}.svg`}
/>
</Helmet>

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,4 @@
<svg width="117" height="117" viewBox="0 0 117 117" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M46.7154 35.6259C48.1678 35.6259 49.6204 35.7604 51.0068 36.0966V33.3396C51.0068 29.4396 52.9874 27.1534 56.9488 27.1534H58.4012V17H53.6476C43.4142 17 39.4531 22.3121 39.4531 31.9276V36.9034C41.7637 36.0966 44.2067 35.6259 46.7154 35.6259ZM107.059 46.9897C107.059 49.6121 108.511 50.8897 110.69 50.8897V50.9568H113.331V61.1103H110.624C108.379 61.1103 106.993 62.3206 106.993 65.0103V69.017C103.728 66.3694 99.8322 64.4685 95.5666 63.5745C95.9032 59.0518 97.6314 57.0187 100.985 56C97.2216 54.7897 95.5051 52.4362 95.5051 46.6535V33.3396C95.5051 29.3724 93.5905 27.1534 89.5633 27.1534H88.1107V17H92.8643C103.098 17 107.059 22.3121 107.059 31.9276V46.9897ZM86.184 63.2676C83.2966 59.0248 78.8606 55.9202 73.7182 54.9226C71.4076 54.452 69.0967 54.3846 66.8521 54.7881C66.8191 54.7881 66.8026 54.7713 66.7861 54.7544C66.7696 54.7376 66.7531 54.7208 66.7201 54.7208C63.0889 46.9881 55.2985 41.8777 46.8477 41.8777C38.397 41.8777 30.6726 46.8537 26.9753 54.5864C26.9423 54.5864 26.9258 54.6032 26.9093 54.62C26.8928 54.6369 26.8763 54.6537 26.8433 54.6537C24.4666 54.3846 22.0898 54.519 19.713 55.1243C11.5264 57.1414 5.32042 64.1346 4.19806 72.607C4.06602 73.4811 4 74.3552 4 75.1623C4 77.7173 5.71655 80.0708 8.22534 80.407C11.3283 80.8778 14.0352 78.457 13.9692 75.364C13.9692 74.8932 13.9692 74.3552 14.0352 73.8846C14.5634 69.5811 17.7984 65.9502 22.0237 64.9414C23.3442 64.6052 24.6646 64.5381 25.919 64.7399C29.9463 65.2778 33.9075 63.1932 35.6241 59.5623C36.8786 56.8726 38.8592 54.519 41.5001 53.2414C44.4048 51.8293 47.706 51.6278 50.7431 52.7037C53.9119 53.8467 56.2886 56.2673 57.7412 59.2932C57.886 59.5754 58.0236 59.8496 58.1569 60.1151L58.1569 60.1152C59.4209 62.6343 60.2943 64.3749 63.221 64.7399C64.5413 64.9414 68.2385 64.8743 69.625 64.807C71.9243 64.807 74.2236 65.4862 76.0374 66.8859C79.0787 65.0448 82.5126 63.787 86.184 63.2676ZM63.4171 94.7536C63.143 93.2104 63 91.6219 63 90C63 88.1659 63.1829 86.3746 63.5314 84.6432H55.3643C52.4596 84.6432 50.1487 82.2899 50.1487 79.3311V59.6293C50.1487 58.8226 49.4886 58.1502 48.6963 58.1502H46.6496C42.6222 58.2173 39.3873 62.7899 39.3873 67.6311V85.3158C39.3873 90.5605 43.5465 94.7967 48.6963 94.7967C48.6963 94.7967 56.7834 94.7729 63.4171 94.7536ZM63.683 32.3331H78.3397C78.6696 32.3331 78.9998 32.0641 78.9998 31.7279V30.5849C78.9998 30.2486 78.7357 29.9797 78.4057 29.9797H63.683C63.3528 29.9797 63.0889 30.2486 63.0889 30.5849V31.7279C63.0889 32.0641 63.3528 32.3331 63.683 32.3331ZM80.8483 46.8566H70.153C69.8228 46.8566 69.5586 46.5875 69.5586 46.2513V45.1083C69.5586 44.7722 69.8228 44.5031 70.153 44.5031H80.8483C81.1785 44.5031 81.4424 44.7722 81.4424 45.1083V46.2513C81.4424 46.5204 81.1785 46.8566 80.8483 46.8566ZM63.683 39.5948H85.0737C85.4039 39.5948 85.602 39.2586 85.602 38.9897V37.8465C85.602 37.5103 85.3379 37.2414 85.0077 37.2414H63.683C63.3528 37.2414 63.0889 37.5103 63.0889 37.8465V38.9897C63.0889 39.3259 63.3528 39.5948 63.683 39.5948Z" fill="white"/>
<circle cx="90" cy="90" r="20" fill="#F44336"/>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,4 @@
<svg width="117" height="117" viewBox="0 0 117 117" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M46.7154 35.6259C48.1678 35.6259 49.6204 35.7604 51.0068 36.0966V33.3396C51.0068 29.4396 52.9874 27.1534 56.9488 27.1534H58.4012V17H53.6476C43.4142 17 39.4531 22.3121 39.4531 31.9276V36.9034C41.7637 36.0966 44.2067 35.6259 46.7154 35.6259ZM107.059 46.9897C107.059 49.6121 108.511 50.8897 110.69 50.8897V50.9568H113.331V61.1103H110.624C108.379 61.1103 106.993 62.3206 106.993 65.0103V69.017C103.728 66.3694 99.8322 64.4685 95.5666 63.5745C95.9032 59.0518 97.6314 57.0187 100.985 56C97.2216 54.7897 95.5051 52.4362 95.5051 46.6535V33.3396C95.5051 29.3724 93.5905 27.1534 89.5633 27.1534H88.1107V17H92.8643C103.098 17 107.059 22.3121 107.059 31.9276V46.9897ZM86.184 63.2676C83.2966 59.0248 78.8606 55.9202 73.7182 54.9226C71.4076 54.452 69.0967 54.3846 66.8521 54.7881C66.8191 54.7881 66.8026 54.7713 66.7861 54.7544C66.7696 54.7376 66.7531 54.7208 66.7201 54.7208C63.0889 46.9881 55.2985 41.8777 46.8477 41.8777C38.397 41.8777 30.6726 46.8537 26.9753 54.5864C26.9423 54.5864 26.9258 54.6032 26.9093 54.62C26.8928 54.6369 26.8763 54.6537 26.8433 54.6537C24.4666 54.3846 22.0898 54.519 19.713 55.1243C11.5264 57.1414 5.32042 64.1346 4.19806 72.607C4.06602 73.4811 4 74.3552 4 75.1623C4 77.7173 5.71655 80.0708 8.22534 80.407C11.3283 80.8778 14.0352 78.457 13.9692 75.364C13.9692 74.8932 13.9692 74.3552 14.0352 73.8846C14.5634 69.5811 17.7984 65.9502 22.0237 64.9414C23.3442 64.6052 24.6646 64.5381 25.919 64.7399C29.9463 65.2778 33.9075 63.1932 35.6241 59.5623C36.8786 56.8726 38.8592 54.519 41.5001 53.2414C44.4048 51.8293 47.706 51.6278 50.7431 52.7037C53.9119 53.8467 56.2886 56.2673 57.7412 59.2932C57.886 59.5754 58.0236 59.8496 58.1569 60.1151L58.1569 60.1152C59.4209 62.6343 60.2943 64.3749 63.221 64.7399C64.5413 64.9414 68.2385 64.8743 69.625 64.807C71.9243 64.807 74.2236 65.4862 76.0374 66.8859C79.0787 65.0448 82.5126 63.787 86.184 63.2676ZM63.4171 94.7536C63.143 93.2104 63 91.6219 63 90C63 88.1659 63.1829 86.3746 63.5314 84.6432H55.3643C52.4596 84.6432 50.1487 82.2899 50.1487 79.3311V59.6293C50.1487 58.8226 49.4886 58.1502 48.6963 58.1502H46.6496C42.6222 58.2173 39.3873 62.7899 39.3873 67.6311V85.3158C39.3873 90.5605 43.5465 94.7967 48.6963 94.7967C48.6963 94.7967 56.7834 94.7729 63.4171 94.7536ZM63.683 32.3331H78.3397C78.6696 32.3331 78.9998 32.0641 78.9998 31.7279V30.5849C78.9998 30.2486 78.7357 29.9797 78.4057 29.9797H63.683C63.3528 29.9797 63.0889 30.2486 63.0889 30.5849V31.7279C63.0889 32.0641 63.3528 32.3331 63.683 32.3331ZM80.8483 46.8566H70.153C69.8228 46.8566 69.5586 46.5875 69.5586 46.2513V45.1083C69.5586 44.7722 69.8228 44.5031 70.153 44.5031H80.8483C81.1785 44.5031 81.4424 44.7722 81.4424 45.1083V46.2513C81.4424 46.5204 81.1785 46.8566 80.8483 46.8566ZM63.683 39.5948H85.0737C85.4039 39.5948 85.602 39.2586 85.602 38.9897V37.8465C85.602 37.5103 85.3379 37.2414 85.0077 37.2414H63.683C63.3528 37.2414 63.0889 37.5103 63.0889 37.8465V38.9897C63.0889 39.3259 63.3528 39.5948 63.683 39.5948Z" fill="white"/>
<circle cx="90" cy="90" r="20" fill="#409BF4"/>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -0,0 +1,4 @@
<svg width="117" height="117" viewBox="0 0 117 117" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M46.7154 35.6259C48.1678 35.6259 49.6204 35.7604 51.0068 36.0966V33.3396C51.0068 29.4396 52.9874 27.1534 56.9488 27.1534H58.4012V17H53.6476C43.4142 17 39.4531 22.3121 39.4531 31.9276V36.9034C41.7637 36.0966 44.2067 35.6259 46.7154 35.6259ZM107.059 46.9897C107.059 49.6121 108.511 50.8897 110.69 50.8897V50.9568H113.331V61.1103H110.624C108.379 61.1103 106.993 62.3206 106.993 65.0103V69.017C103.728 66.3694 99.8322 64.4685 95.5666 63.5745C95.9032 59.0518 97.6314 57.0187 100.985 56C97.2216 54.7897 95.5051 52.4362 95.5051 46.6535V33.3396C95.5051 29.3724 93.5905 27.1534 89.5633 27.1534H88.1107V17H92.8643C103.098 17 107.059 22.3121 107.059 31.9276V46.9897ZM86.184 63.2676C83.2966 59.0248 78.8606 55.9202 73.7182 54.9226C71.4076 54.452 69.0967 54.3846 66.8521 54.7881C66.8191 54.7881 66.8026 54.7713 66.7861 54.7544C66.7696 54.7376 66.7531 54.7208 66.7201 54.7208C63.0889 46.9881 55.2985 41.8777 46.8477 41.8777C38.397 41.8777 30.6726 46.8537 26.9753 54.5864C26.9423 54.5864 26.9258 54.6032 26.9093 54.62C26.8928 54.6369 26.8763 54.6537 26.8433 54.6537C24.4666 54.3846 22.0898 54.519 19.713 55.1243C11.5264 57.1414 5.32042 64.1346 4.19806 72.607C4.06602 73.4811 4 74.3552 4 75.1623C4 77.7173 5.71655 80.0708 8.22534 80.407C11.3283 80.8778 14.0352 78.457 13.9692 75.364C13.9692 74.8932 13.9692 74.3552 14.0352 73.8846C14.5634 69.5811 17.7984 65.9502 22.0237 64.9414C23.3442 64.6052 24.6646 64.5381 25.919 64.7399C29.9463 65.2778 33.9075 63.1932 35.6241 59.5623C36.8786 56.8726 38.8592 54.519 41.5001 53.2414C44.4048 51.8293 47.706 51.6278 50.7431 52.7037C53.9119 53.8467 56.2886 56.2673 57.7412 59.2932C57.886 59.5754 58.0236 59.8496 58.1569 60.1151L58.1569 60.1152C59.4209 62.6343 60.2943 64.3749 63.221 64.7399C64.5413 64.9414 68.2385 64.8743 69.625 64.807C71.9243 64.807 74.2236 65.4862 76.0374 66.8859C79.0787 65.0448 82.5126 63.787 86.184 63.2676ZM63.4171 94.7536C63.143 93.2104 63 91.6219 63 90C63 88.1659 63.1829 86.3746 63.5314 84.6432H55.3643C52.4596 84.6432 50.1487 82.2899 50.1487 79.3311V59.6293C50.1487 58.8226 49.4886 58.1502 48.6963 58.1502H46.6496C42.6222 58.2173 39.3873 62.7899 39.3873 67.6311V85.3158C39.3873 90.5605 43.5465 94.7967 48.6963 94.7967C48.6963 94.7967 56.7834 94.7729 63.4171 94.7536ZM63.683 32.3331H78.3397C78.6696 32.3331 78.9998 32.0641 78.9998 31.7279V30.5849C78.9998 30.2486 78.7357 29.9797 78.4057 29.9797H63.683C63.3528 29.9797 63.0889 30.2486 63.0889 30.5849V31.7279C63.0889 32.0641 63.3528 32.3331 63.683 32.3331ZM80.8483 46.8566H70.153C69.8228 46.8566 69.5586 46.5875 69.5586 46.2513V45.1083C69.5586 44.7722 69.8228 44.5031 70.153 44.5031H80.8483C81.1785 44.5031 81.4424 44.7722 81.4424 45.1083V46.2513C81.4424 46.5204 81.1785 46.8566 80.8483 46.8566ZM63.683 39.5948H85.0737C85.4039 39.5948 85.602 39.2586 85.602 38.9897V37.8465C85.602 37.5103 85.3379 37.2414 85.0077 37.2414H63.683C63.3528 37.2414 63.0889 37.5103 63.0889 37.8465V38.9897C63.0889 39.3259 63.3528 39.5948 63.683 39.5948Z" fill="white"/>
<circle cx="90" cy="90" r="20" fill="#6BBE00"/>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -0,0 +1,4 @@
<svg width="117" height="117" viewBox="0 0 117 117" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M46.7154 35.6259C48.1678 35.6259 49.6204 35.7604 51.0068 36.0966V33.3396C51.0068 29.4396 52.9874 27.1534 56.9488 27.1534H58.4012V17H53.6476C43.4142 17 39.4531 22.3121 39.4531 31.9276V36.9034C41.7637 36.0966 44.2067 35.6259 46.7154 35.6259ZM107.059 46.9897C107.059 49.6121 108.511 50.8897 110.69 50.8897V50.9568H113.331V61.1103H110.624C108.379 61.1103 106.993 62.3206 106.993 65.0103V69.017C103.728 66.3694 99.8322 64.4685 95.5666 63.5745C95.9032 59.0518 97.6314 57.0187 100.985 56C97.2216 54.7897 95.5051 52.4362 95.5051 46.6535V33.3396C95.5051 29.3724 93.5905 27.1534 89.5633 27.1534H88.1107V17H92.8643C103.098 17 107.059 22.3121 107.059 31.9276V46.9897ZM86.184 63.2676C83.2966 59.0248 78.8606 55.9202 73.7182 54.9226C71.4076 54.452 69.0967 54.3846 66.8521 54.7881C66.8191 54.7881 66.8026 54.7713 66.7861 54.7544C66.7696 54.7376 66.7531 54.7208 66.7201 54.7208C63.0889 46.9881 55.2985 41.8777 46.8477 41.8777C38.397 41.8777 30.6726 46.8537 26.9753 54.5864C26.9423 54.5864 26.9258 54.6032 26.9093 54.62C26.8928 54.6369 26.8763 54.6537 26.8433 54.6537C24.4666 54.3846 22.0898 54.519 19.713 55.1243C11.5264 57.1414 5.32042 64.1346 4.19806 72.607C4.06602 73.4811 4 74.3552 4 75.1623C4 77.7173 5.71655 80.0708 8.22534 80.407C11.3283 80.8778 14.0352 78.457 13.9692 75.364C13.9692 74.8932 13.9692 74.3552 14.0352 73.8846C14.5634 69.5811 17.7984 65.9502 22.0237 64.9414C23.3442 64.6052 24.6646 64.5381 25.919 64.7399C29.9463 65.2778 33.9075 63.1932 35.6241 59.5623C36.8786 56.8726 38.8592 54.519 41.5001 53.2414C44.4048 51.8293 47.706 51.6278 50.7431 52.7037C53.9119 53.8467 56.2886 56.2673 57.7412 59.2932C57.886 59.5754 58.0236 59.8496 58.1569 60.1151L58.1569 60.1152C59.4209 62.6343 60.2943 64.3749 63.221 64.7399C64.5413 64.9414 68.2385 64.8743 69.625 64.807C71.9243 64.807 74.2236 65.4862 76.0374 66.8859C79.0787 65.0448 82.5126 63.787 86.184 63.2676ZM63.4171 94.7536C63.143 93.2104 63 91.6219 63 90C63 88.1659 63.1829 86.3746 63.5314 84.6432H55.3643C52.4596 84.6432 50.1487 82.2899 50.1487 79.3311V59.6293C50.1487 58.8226 49.4886 58.1502 48.6963 58.1502H46.6496C42.6222 58.2173 39.3873 62.7899 39.3873 67.6311V85.3158C39.3873 90.5605 43.5465 94.7967 48.6963 94.7967C48.6963 94.7967 56.7834 94.7729 63.4171 94.7536ZM63.683 32.3331H78.3397C78.6696 32.3331 78.9998 32.0641 78.9998 31.7279V30.5849C78.9998 30.2486 78.7357 29.9797 78.4057 29.9797H63.683C63.3528 29.9797 63.0889 30.2486 63.0889 30.5849V31.7279C63.0889 32.0641 63.3528 32.3331 63.683 32.3331ZM80.8483 46.8566H70.153C69.8228 46.8566 69.5586 46.5875 69.5586 46.2513V45.1083C69.5586 44.7722 69.8228 44.5031 70.153 44.5031H80.8483C81.1785 44.5031 81.4424 44.7722 81.4424 45.1083V46.2513C81.4424 46.5204 81.1785 46.8566 80.8483 46.8566ZM63.683 39.5948H85.0737C85.4039 39.5948 85.602 39.2586 85.602 38.9897V37.8465C85.602 37.5103 85.3379 37.2414 85.0077 37.2414H63.683C63.3528 37.2414 63.0889 37.5103 63.0889 37.8465V38.9897C63.0889 39.3259 63.3528 39.5948 63.683 39.5948Z" fill="white"/>
<circle cx="90" cy="90" r="20" fill="#FFB74D"/>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB