Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
bit-pm
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
燕伟桐
bit-pm
Commits
1d0176d1
提交
1d0176d1
authored
4月 23, 2025
作者:
Will Chen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polish app details & supabase connector UX
上级
9828cb3d
全部展开
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
162 行增加
和
60 行删除
+162
-60
connect-supabase-dark.svg
assets/supabase/connect-supabase-dark.svg
+23
-0
connect-supabase-light.svg
assets/supabase/connect-supabase-light.svg
+23
-0
supabase-logo-wordmark--dark.svg
assets/supabase/supabase-logo-wordmark--dark.svg
+23
-0
supabase-logo-wordmark--light.svg
assets/supabase/supabase-logo-wordmark--light.svg
+23
-0
GitHubConnector.tsx
src/components/GitHubConnector.tsx
+2
-2
SupabaseConnector.tsx
src/components/SupabaseConnector.tsx
+47
-35
CodeHighlight.tsx
src/components/chat/CodeHighlight.tsx
+1
-22
ThemeContext.tsx
src/contexts/ThemeContext.tsx
+20
-1
app-details.tsx
src/pages/app-details.tsx
+0
-0
没有找到文件。
assets/supabase/connect-supabase-dark.svg
0 → 100644
浏览文件 @
1d0176d1
<svg
width=
"156"
height=
"31"
viewBox=
"0 0 156 31"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<rect
x=
"0.5"
y=
"1"
width=
"155"
height=
"29"
rx=
"4.5"
fill=
"#1C1C1C"
/>
<g
clip-path=
"url(#clip0_87_2423)"
>
<path
d=
"M19.1825 22.5142C18.8152 22.9839 18.0706 22.7265 18.0617 22.1269L17.9323 13.3564H23.7403C24.7923 13.3564 25.3791 14.5901 24.7249 15.4266L19.1825 22.5142Z"
fill=
"url(#paint0_linear_87_2423)"
/>
<path
d=
"M19.1825 22.5142C18.8152 22.9839 18.0706 22.7265 18.0617 22.1269L17.9323 13.3564H23.7403C24.7923 13.3564 25.3791 14.5901 24.7249 15.4266L19.1825 22.5142Z"
fill=
"url(#paint1_linear_87_2423)"
fill-opacity=
"0.2"
/>
<path
d=
"M16.8204 8.4017C17.1877 7.93203 17.9324 8.18937 17.9412 8.78903L17.9979 17.5596H12.2626C11.2106 17.5596 10.6238 16.3258 11.278 15.4893L16.8204 8.4017Z"
fill=
"#3ECF8E"
/>
</g>
<path
d=
"M38.1776 20.695C35.7986 20.695 33.6016 18.966 33.6016 15.885C33.6016 12.804 35.8896 11.088 38.1776 11.088C40.2836 11.088 41.7656 12.232 42.2336 14.013L41.0506 14.429C40.6996 13.038 39.6856 12.258 38.1776 12.258C36.5006 12.258 34.9016 13.48 34.9016 15.885C34.9016 18.29 36.5006 19.525 38.1776 19.525C39.7506 19.525 40.7386 18.576 41.1156 17.315L42.2466 17.731C41.7526 19.46 40.2966 20.695 38.1776 20.695ZM46.2307 19.603C47.2707 19.603 48.1807 18.823 48.1807 17.367C48.1807 15.924 47.2707 15.144 46.2307 15.144C45.1907 15.144 44.2807 15.924 44.2807 17.367C44.2807 18.823 45.1907 19.603 46.2307 19.603ZM46.2307 14.052C48.1027 14.052 49.4287 15.469 49.4287 17.367C49.4287 19.278 48.1027 20.695 46.2307 20.695C44.3587 20.695 43.0327 19.278 43.0327 17.367C43.0327 15.469 44.3587 14.052 46.2307 14.052ZM52.2141 16.886V20.5H50.9921V14.247H52.1881V15.144C52.6431 14.364 53.3841 14.065 54.1121 14.065C55.6071 14.065 56.3481 15.144 56.3481 16.535V20.5H55.1261V16.743C55.1261 15.872 54.7621 15.17 53.6701 15.17C52.7081 15.17 52.2141 15.937 52.2141 16.886ZM59.514 16.886V20.5H58.292V14.247H59.488V15.144C59.943 14.364 60.684 14.065 61.412 14.065C62.907 14.065 63.648 15.144 63.648 16.535V20.5H62.426V16.743C62.426 15.872 62.062 15.17 60.97 15.17C60.008 15.17 59.514 15.937 59.514 16.886ZM66.3848 16.73H69.8038C69.7778 15.833 69.1928 15.131 68.0878 15.131C67.0608 15.131 66.4368 15.924 66.3848 16.73ZM69.9858 18.355L71.0388 18.719C70.6878 19.824 69.6868 20.695 68.2308 20.695C66.5538 20.695 65.0848 19.473 65.0848 17.354C65.0848 15.391 66.5018 14.052 68.0748 14.052C69.9988 14.052 71.0778 15.378 71.0778 17.328C71.0778 17.484 71.0648 17.64 71.0518 17.718H66.3458C66.3718 18.836 67.1778 19.616 68.2308 19.616C69.2448 19.616 69.7518 19.057 69.9858 18.355ZM75.2637 15.183C74.2757 15.183 73.3657 15.911 73.3657 17.367C73.3657 18.797 74.2627 19.564 75.2767 19.564C76.4467 19.564 76.8757 18.771 77.0187 18.277L78.0977 18.745C77.7987 19.642 76.9017 20.695 75.2767 20.695C73.4567 20.695 72.1177 19.265 72.1177 17.367C72.1177 15.417 73.4827 14.052 75.2637 14.052C76.9277 14.052 77.7857 15.092 78.0457 16.041L76.9407 16.509C76.7847 15.898 76.3297 15.183 75.2637 15.183ZM81.1692 12.271V14.247H82.5212V15.352H81.1692V18.602C81.1692 19.174 81.4032 19.46 82.0402 19.46C82.1962 19.46 82.4172 19.434 82.5212 19.408V20.448C82.4172 20.487 82.1052 20.565 81.6892 20.565C80.6232 20.565 79.9472 19.915 79.9472 18.784V15.352H78.7512V14.247H79.0892C79.7652 14.247 80.0512 13.831 80.0512 13.285V12.271H81.1692ZM93.4083 13.376L92.2643 13.779C92.1603 13.116 91.6013 12.206 90.3143 12.206C89.2743 12.206 88.5333 12.882 88.5333 13.74C88.5333 14.403 88.9363 14.91 89.7163 15.079L91.0943 15.378C92.6283 15.716 93.4863 16.678 93.4863 17.965C93.4863 19.395 92.2643 20.695 90.3013 20.695C88.0783 20.695 87.0253 19.265 86.8563 17.952L88.0783 17.562C88.1693 18.589 88.8973 19.538 90.2883 19.538C91.5623 19.538 92.1863 18.875 92.1863 18.069C92.1863 17.406 91.7313 16.834 90.8083 16.639L89.4953 16.353C88.1823 16.067 87.2463 15.209 87.2463 13.831C87.2463 12.388 88.5853 11.088 90.2883 11.088C92.3683 11.088 93.2003 12.375 93.4083 13.376ZM98.8993 19.746C98.5613 20.396 97.7813 20.695 97.0533 20.695C95.5973 20.695 94.7133 19.603 94.7133 18.186V14.247H95.9353V18.004C95.9353 18.862 96.3253 19.616 97.3523 19.616C98.3403 19.616 98.8343 18.966 98.8343 18.017V14.247H100.056V19.343C100.056 19.837 100.095 20.279 100.121 20.5H98.9513C98.9253 20.357 98.8993 20.006 98.8993 19.746ZM103.351 22.97H102.142V14.247H103.325V15.222C103.663 14.598 104.404 14.104 105.418 14.104C107.29 14.104 108.291 15.547 108.291 17.367C108.291 19.226 107.212 20.669 105.379 20.669C104.417 20.669 103.689 20.214 103.351 19.655V22.97ZM107.043 17.367C107.043 16.119 106.341 15.183 105.197 15.183C104.079 15.183 103.338 16.119 103.338 17.367C103.338 18.654 104.079 19.577 105.197 19.577C106.328 19.577 107.043 18.654 107.043 17.367ZM109.458 18.823C109.458 17.705 110.277 17.081 111.356 16.925L113.046 16.678C113.423 16.626 113.527 16.431 113.527 16.21C113.527 15.599 113.124 15.092 112.175 15.092C111.317 15.092 110.836 15.625 110.758 16.353L109.588 16.08C109.718 14.884 110.797 14.052 112.149 14.052C114.021 14.052 114.749 15.118 114.749 16.34V19.473C114.749 20.019 114.801 20.344 114.827 20.5H113.631C113.605 20.344 113.566 20.11 113.566 19.655C113.293 20.097 112.669 20.695 111.551 20.695C110.277 20.695 109.458 19.811 109.458 18.823ZM111.72 19.668C112.721 19.668 113.527 19.187 113.527 17.822V17.536L111.616 17.822C111.096 17.9 110.706 18.199 110.706 18.758C110.706 19.226 111.096 19.668 111.72 19.668ZM117.861 20.5H116.652V11.088H117.861V15.131C118.16 14.572 118.888 14.065 119.928 14.065C121.826 14.065 122.801 15.521 122.801 17.341C122.801 19.2 121.748 20.669 119.889 20.669C118.966 20.669 118.251 20.266 117.861 19.59V20.5ZM121.553 17.341C121.553 15.989 120.838 15.144 119.707 15.144C118.628 15.144 117.848 15.989 117.848 17.341C117.848 18.693 118.628 19.577 119.707 19.577C120.825 19.577 121.553 18.693 121.553 17.341ZM123.968 18.823C123.968 17.705 124.787 17.081 125.866 16.925L127.556 16.678C127.933 16.626 128.037 16.431 128.037 16.21C128.037 15.599 127.634 15.092 126.685 15.092C125.827 15.092 125.346 15.625 125.268 16.353L124.098 16.08C124.228 14.884 125.307 14.052 126.659 14.052C128.531 14.052 129.259 15.118 129.259 16.34V19.473C129.259 20.019 129.311 20.344 129.337 20.5H128.141C128.115 20.344 128.076 20.11 128.076 19.655C127.803 20.097 127.179 20.695 126.061 20.695C124.787 20.695 123.968 19.811 123.968 18.823ZM126.23 19.668C127.231 19.668 128.037 19.187 128.037 17.822V17.536L126.126 17.822C125.606 17.9 125.216 18.199 125.216 18.758C125.216 19.226 125.606 19.668 126.23 19.668ZM130.578 18.875L131.683 18.485C131.761 19.135 132.255 19.655 133.139 19.655C133.828 19.655 134.205 19.265 134.205 18.823C134.205 18.433 133.919 18.134 133.399 18.017L132.333 17.783C131.358 17.575 130.773 16.912 130.773 16.028C130.773 14.962 131.774 14.052 132.996 14.052C134.712 14.052 135.245 15.17 135.375 15.729L134.296 16.132C134.244 15.807 133.984 15.092 132.996 15.092C132.372 15.092 131.956 15.495 131.956 15.924C131.956 16.301 132.19 16.574 132.671 16.678L133.685 16.899C134.816 17.146 135.414 17.835 135.414 18.758C135.414 19.642 134.673 20.695 133.126 20.695C131.41 20.695 130.682 19.59 130.578 18.875ZM137.771 16.73H141.19C141.164 15.833 140.579 15.131 139.474 15.131C138.447 15.131 137.823 15.924 137.771 16.73ZM141.372 18.355L142.425 18.719C142.074 19.824 141.073 20.695 139.617 20.695C137.94 20.695 136.471 19.473 136.471 17.354C136.471 15.391 137.888 14.052 139.461 14.052C141.385 14.052 142.464 15.378 142.464 17.328C142.464 17.484 142.451 17.64 142.438 17.718H137.732C137.758 18.836 138.564 19.616 139.617 19.616C140.631 19.616 141.138 19.057 141.372 18.355Z"
fill=
"#EDEDED"
/>
<rect
x=
"0.5"
y=
"1"
width=
"155"
height=
"29"
rx=
"4.5"
stroke=
"#2E2E2E"
/>
<defs>
<linearGradient
id=
"paint0_linear_87_2423"
x1=
"17.9323"
y1=
"15.301"
x2=
"23.1176"
y2=
"17.4428"
gradientUnits=
"userSpaceOnUse"
>
<stop
stop-color=
"#249361"
/>
<stop
offset=
"1"
stop-color=
"#3ECF8E"
/>
</linearGradient>
<linearGradient
id=
"paint1_linear_87_2423"
x1=
"15.6438"
y1=
"12.1194"
x2=
"18.0544"
y2=
"16.5886"
gradientUnits=
"userSpaceOnUse"
>
<stop/>
<stop
offset=
"1"
stop-opacity=
"0"
/>
</linearGradient>
<clipPath
id=
"clip0_87_2423"
>
<rect
width=
"14"
height=
"14.7368"
fill=
"white"
transform=
"translate(11 8.13159)"
/>
</clipPath>
</defs>
</svg>
assets/supabase/connect-supabase-light.svg
0 → 100644
浏览文件 @
1d0176d1
<svg
width=
"156"
height=
"31"
viewBox=
"0 0 156 31"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<rect
x=
"0.5"
y=
"0.82959"
width=
"155"
height=
"29"
rx=
"4.5"
fill=
"#F1F3F5"
/>
<g
clip-path=
"url(#clip0_87_2434)"
>
<path
d=
"M19.1825 22.3438C18.8152 22.8134 18.0706 22.5561 18.0617 21.9565L17.9323 13.1859H23.7403C24.7923 13.1859 25.3791 14.4197 24.7249 15.2562L19.1825 22.3438Z"
fill=
"url(#paint0_linear_87_2434)"
/>
<path
d=
"M19.1825 22.3438C18.8152 22.8134 18.0706 22.5561 18.0617 21.9565L17.9323 13.1859H23.7403C24.7923 13.1859 25.3791 14.4197 24.7249 15.2562L19.1825 22.3438Z"
fill=
"url(#paint1_linear_87_2434)"
fill-opacity=
"0.2"
/>
<path
d=
"M16.8204 8.23129C17.1877 7.76162 17.9324 8.01896 17.9412 8.61862L17.9979 17.3892H12.2626C11.2106 17.3892 10.6238 16.1554 11.278 15.3189L16.8204 8.23129Z"
fill=
"#3ECF8E"
/>
</g>
<path
d=
"M38.1776 20.5246C35.7986 20.5246 33.6016 18.7956 33.6016 15.7146C33.6016 12.6336 35.8896 10.9176 38.1776 10.9176C40.2836 10.9176 41.7656 12.0616 42.2336 13.8426L41.0506 14.2586C40.6996 12.8676 39.6856 12.0876 38.1776 12.0876C36.5006 12.0876 34.9016 13.3096 34.9016 15.7146C34.9016 18.1196 36.5006 19.3546 38.1776 19.3546C39.7506 19.3546 40.7386 18.4056 41.1156 17.1446L42.2466 17.5606C41.7526 19.2896 40.2966 20.5246 38.1776 20.5246ZM46.2307 19.4326C47.2707 19.4326 48.1807 18.6526 48.1807 17.1966C48.1807 15.7536 47.2707 14.9736 46.2307 14.9736C45.1907 14.9736 44.2807 15.7536 44.2807 17.1966C44.2807 18.6526 45.1907 19.4326 46.2307 19.4326ZM46.2307 13.8816C48.1027 13.8816 49.4287 15.2986 49.4287 17.1966C49.4287 19.1076 48.1027 20.5246 46.2307 20.5246C44.3587 20.5246 43.0327 19.1076 43.0327 17.1966C43.0327 15.2986 44.3587 13.8816 46.2307 13.8816ZM52.2141 16.7156V20.3296H50.9921V14.0766H52.1881V14.9736C52.6431 14.1936 53.3841 13.8946 54.1121 13.8946C55.6071 13.8946 56.3481 14.9736 56.3481 16.3646V20.3296H55.1261V16.5726C55.1261 15.7016 54.7621 14.9996 53.6701 14.9996C52.7081 14.9996 52.2141 15.7666 52.2141 16.7156ZM59.514 16.7156V20.3296H58.292V14.0766H59.488V14.9736C59.943 14.1936 60.684 13.8946 61.412 13.8946C62.907 13.8946 63.648 14.9736 63.648 16.3646V20.3296H62.426V16.5726C62.426 15.7016 62.062 14.9996 60.97 14.9996C60.008 14.9996 59.514 15.7666 59.514 16.7156ZM66.3848 16.5596H69.8038C69.7778 15.6626 69.1928 14.9606 68.0878 14.9606C67.0608 14.9606 66.4368 15.7536 66.3848 16.5596ZM69.9858 18.1846L71.0388 18.5486C70.6878 19.6536 69.6868 20.5246 68.2308 20.5246C66.5538 20.5246 65.0848 19.3026 65.0848 17.1836C65.0848 15.2206 66.5018 13.8816 68.0748 13.8816C69.9988 13.8816 71.0778 15.2076 71.0778 17.1576C71.0778 17.3136 71.0648 17.4696 71.0518 17.5476H66.3458C66.3718 18.6656 67.1778 19.4456 68.2308 19.4456C69.2448 19.4456 69.7518 18.8866 69.9858 18.1846ZM75.2637 15.0126C74.2757 15.0126 73.3657 15.7406 73.3657 17.1966C73.3657 18.6266 74.2627 19.3936 75.2767 19.3936C76.4467 19.3936 76.8757 18.6006 77.0187 18.1066L78.0977 18.5746C77.7987 19.4716 76.9017 20.5246 75.2767 20.5246C73.4567 20.5246 72.1177 19.0946 72.1177 17.1966C72.1177 15.2466 73.4827 13.8816 75.2637 13.8816C76.9277 13.8816 77.7857 14.9216 78.0457 15.8706L76.9407 16.3386C76.7847 15.7276 76.3297 15.0126 75.2637 15.0126ZM81.1692 12.1006V14.0766H82.5212V15.1816H81.1692V18.4316C81.1692 19.0036 81.4032 19.2896 82.0402 19.2896C82.1962 19.2896 82.4172 19.2636 82.5212 19.2376V20.2776C82.4172 20.3166 82.1052 20.3946 81.6892 20.3946C80.6232 20.3946 79.9472 19.7446 79.9472 18.6136V15.1816H78.7512V14.0766H79.0892C79.7652 14.0766 80.0512 13.6606 80.0512 13.1146V12.1006H81.1692ZM93.4083 13.2056L92.2643 13.6086C92.1603 12.9456 91.6013 12.0356 90.3143 12.0356C89.2743 12.0356 88.5333 12.7116 88.5333 13.5696C88.5333 14.2326 88.9363 14.7396 89.7163 14.9086L91.0943 15.2076C92.6283 15.5456 93.4863 16.5076 93.4863 17.7946C93.4863 19.2246 92.2643 20.5246 90.3013 20.5246C88.0783 20.5246 87.0253 19.0946 86.8563 17.7816L88.0783 17.3916C88.1693 18.4186 88.8973 19.3676 90.2883 19.3676C91.5623 19.3676 92.1863 18.7046 92.1863 17.8986C92.1863 17.2356 91.7313 16.6636 90.8083 16.4686L89.4953 16.1826C88.1823 15.8966 87.2463 15.0386 87.2463 13.6606C87.2463 12.2176 88.5853 10.9176 90.2883 10.9176C92.3683 10.9176 93.2003 12.2046 93.4083 13.2056ZM98.8993 19.5756C98.5613 20.2256 97.7813 20.5246 97.0533 20.5246C95.5973 20.5246 94.7133 19.4326 94.7133 18.0156V14.0766H95.9353V17.8336C95.9353 18.6916 96.3253 19.4456 97.3523 19.4456C98.3403 19.4456 98.8343 18.7956 98.8343 17.8466V14.0766H100.056V19.1726C100.056 19.6666 100.095 20.1086 100.121 20.3296H98.9513C98.9253 20.1866 98.8993 19.8356 98.8993 19.5756ZM103.351 22.7996H102.142V14.0766H103.325V15.0516C103.663 14.4276 104.404 13.9336 105.418 13.9336C107.29 13.9336 108.291 15.3766 108.291 17.1966C108.291 19.0556 107.212 20.4986 105.379 20.4986C104.417 20.4986 103.689 20.0436 103.351 19.4846V22.7996ZM107.043 17.1966C107.043 15.9486 106.341 15.0126 105.197 15.0126C104.079 15.0126 103.338 15.9486 103.338 17.1966C103.338 18.4836 104.079 19.4066 105.197 19.4066C106.328 19.4066 107.043 18.4836 107.043 17.1966ZM109.458 18.6526C109.458 17.5346 110.277 16.9106 111.356 16.7546L113.046 16.5076C113.423 16.4556 113.527 16.2606 113.527 16.0396C113.527 15.4286 113.124 14.9216 112.175 14.9216C111.317 14.9216 110.836 15.4546 110.758 16.1826L109.588 15.9096C109.718 14.7136 110.797 13.8816 112.149 13.8816C114.021 13.8816 114.749 14.9476 114.749 16.1696V19.3026C114.749 19.8486 114.801 20.1736 114.827 20.3296H113.631C113.605 20.1736 113.566 19.9396 113.566 19.4846C113.293 19.9266 112.669 20.5246 111.551 20.5246C110.277 20.5246 109.458 19.6406 109.458 18.6526ZM111.72 19.4976C112.721 19.4976 113.527 19.0166 113.527 17.6516V17.3656L111.616 17.6516C111.096 17.7296 110.706 18.0286 110.706 18.5876C110.706 19.0556 111.096 19.4976 111.72 19.4976ZM117.861 20.3296H116.652V10.9176H117.861V14.9606C118.16 14.4016 118.888 13.8946 119.928 13.8946C121.826 13.8946 122.801 15.3506 122.801 17.1706C122.801 19.0296 121.748 20.4986 119.889 20.4986C118.966 20.4986 118.251 20.0956 117.861 19.4196V20.3296ZM121.553 17.1706C121.553 15.8186 120.838 14.9736 119.707 14.9736C118.628 14.9736 117.848 15.8186 117.848 17.1706C117.848 18.5226 118.628 19.4066 119.707 19.4066C120.825 19.4066 121.553 18.5226 121.553 17.1706ZM123.968 18.6526C123.968 17.5346 124.787 16.9106 125.866 16.7546L127.556 16.5076C127.933 16.4556 128.037 16.2606 128.037 16.0396C128.037 15.4286 127.634 14.9216 126.685 14.9216C125.827 14.9216 125.346 15.4546 125.268 16.1826L124.098 15.9096C124.228 14.7136 125.307 13.8816 126.659 13.8816C128.531 13.8816 129.259 14.9476 129.259 16.1696V19.3026C129.259 19.8486 129.311 20.1736 129.337 20.3296H128.141C128.115 20.1736 128.076 19.9396 128.076 19.4846C127.803 19.9266 127.179 20.5246 126.061 20.5246C124.787 20.5246 123.968 19.6406 123.968 18.6526ZM126.23 19.4976C127.231 19.4976 128.037 19.0166 128.037 17.6516V17.3656L126.126 17.6516C125.606 17.7296 125.216 18.0286 125.216 18.5876C125.216 19.0556 125.606 19.4976 126.23 19.4976ZM130.578 18.7046L131.683 18.3146C131.761 18.9646 132.255 19.4846 133.139 19.4846C133.828 19.4846 134.205 19.0946 134.205 18.6526C134.205 18.2626 133.919 17.9636 133.399 17.8466L132.333 17.6126C131.358 17.4046 130.773 16.7416 130.773 15.8576C130.773 14.7916 131.774 13.8816 132.996 13.8816C134.712 13.8816 135.245 14.9996 135.375 15.5586L134.296 15.9616C134.244 15.6366 133.984 14.9216 132.996 14.9216C132.372 14.9216 131.956 15.3246 131.956 15.7536C131.956 16.1306 132.19 16.4036 132.671 16.5076L133.685 16.7286C134.816 16.9756 135.414 17.6646 135.414 18.5876C135.414 19.4716 134.673 20.5246 133.126 20.5246C131.41 20.5246 130.682 19.4196 130.578 18.7046ZM137.771 16.5596H141.19C141.164 15.6626 140.579 14.9606 139.474 14.9606C138.447 14.9606 137.823 15.7536 137.771 16.5596ZM141.372 18.1846L142.425 18.5486C142.074 19.6536 141.073 20.5246 139.617 20.5246C137.94 20.5246 136.471 19.3026 136.471 17.1836C136.471 15.2206 137.888 13.8816 139.461 13.8816C141.385 13.8816 142.464 15.2076 142.464 17.1576C142.464 17.3136 142.451 17.4696 142.438 17.5476H137.732C137.758 18.6656 138.564 19.4456 139.617 19.4456C140.631 19.4456 141.138 18.8866 141.372 18.1846Z"
fill=
"#11181C"
/>
<rect
x=
"0.5"
y=
"0.82959"
width=
"155"
height=
"29"
rx=
"4.5"
stroke=
"#E6E8EB"
/>
<defs>
<linearGradient
id=
"paint0_linear_87_2434"
x1=
"17.9323"
y1=
"15.1306"
x2=
"23.1176"
y2=
"17.2724"
gradientUnits=
"userSpaceOnUse"
>
<stop
stop-color=
"#249361"
/>
<stop
offset=
"1"
stop-color=
"#3ECF8E"
/>
</linearGradient>
<linearGradient
id=
"paint1_linear_87_2434"
x1=
"15.6438"
y1=
"11.949"
x2=
"18.0544"
y2=
"16.4182"
gradientUnits=
"userSpaceOnUse"
>
<stop/>
<stop
offset=
"1"
stop-opacity=
"0"
/>
</linearGradient>
<clipPath
id=
"clip0_87_2434"
>
<rect
width=
"14"
height=
"14.7368"
fill=
"white"
transform=
"translate(11 7.96118)"
/>
</clipPath>
</defs>
</svg>
assets/supabase/supabase-logo-wordmark--dark.svg
0 → 100644
浏览文件 @
1d0176d1
<svg
width=
"581"
height=
"113"
viewBox=
"0 0 581 113"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<path
d=
"M151.397 66.7608C151.996 72.3621 157.091 81.9642 171.877 81.9642C184.764 81.9642 190.959 73.7624 190.959 65.7607C190.959 58.559 186.063 52.6577 176.373 50.6571L169.379 49.1569C166.682 48.6568 164.884 47.1565 164.884 44.7559C164.884 41.9552 167.681 39.8549 171.178 39.8549C176.772 39.8549 178.87 43.5556 179.27 46.4564L190.359 43.9558C189.76 38.6546 185.064 29.7527 171.078 29.7527C160.488 29.7527 152.696 37.0543 152.696 45.8561C152.696 52.7576 156.991 58.4591 166.482 60.5594L172.976 62.0598C176.772 62.8599 178.271 64.6605 178.271 66.8609C178.271 69.4615 176.173 71.762 171.777 71.762C165.983 71.762 163.085 68.1611 162.786 64.2602L151.397 66.7608Z"
fill=
"white"
/>
<path
d=
"M233.421 80.4639H246.109C245.909 78.7635 245.609 75.3628 245.609 71.5618V31.2529H232.321V59.8592C232.321 65.5606 228.925 69.5614 223.031 69.5614C216.837 69.5614 214.039 65.1604 214.039 59.6592V31.2529H200.752V62.3599C200.752 73.0622 207.545 81.7642 219.434 81.7642C224.628 81.7642 230.325 79.7638 233.022 75.1627C233.022 77.1631 233.221 79.4636 233.421 80.4639Z"
fill=
"white"
/>
<path
d=
"M273.076 99.4682V75.663C275.473 78.9636 280.469 81.6644 287.263 81.6644C301.149 81.6644 310.439 70.6617 310.439 55.7584C310.439 41.1553 302.148 30.1528 287.762 30.1528C280.37 30.1528 274.875 33.4534 272.677 37.2544V31.253H259.79V99.4682H273.076ZM297.352 55.8585C297.352 64.6606 291.958 69.7616 285.164 69.7616C278.372 69.7616 272.877 64.5605 272.877 55.8585C272.877 47.1566 278.372 42.0554 285.164 42.0554C291.958 42.0554 297.352 47.1566 297.352 55.8585Z"
fill=
"white"
/>
<path
d=
"M317.964 67.0609C317.964 74.7627 324.357 81.8643 334.848 81.8643C342.139 81.8643 346.835 78.4634 349.332 74.5625C349.332 76.463 349.532 79.1635 349.832 80.4639H362.02C361.72 78.7635 361.422 75.2627 361.422 72.6622V48.4567C361.422 38.5545 355.627 29.7527 340.043 29.7527C326.855 29.7527 319.761 38.2544 318.963 45.9562L330.751 48.4567C331.151 44.1558 334.348 40.455 340.141 40.455C345.737 40.455 348.434 43.3556 348.434 46.8564C348.434 48.5568 347.536 49.9572 344.738 50.3572L332.65 52.1576C324.458 53.3579 317.964 58.2589 317.964 67.0609ZM337.644 71.962C333.349 71.962 331.25 69.1614 331.25 66.2608C331.25 62.4599 333.947 60.5594 337.345 60.0594L348.434 58.359V60.5594C348.434 69.2615 343.239 71.962 337.644 71.962Z"
fill=
"white"
/>
<path
d=
"M387.703 80.4641V74.4627C390.299 78.6637 395.494 81.6644 402.288 81.6644C416.276 81.6644 425.467 70.5618 425.467 55.6585C425.467 41.0552 417.174 29.9528 402.788 29.9528C395.494 29.9528 390.1 33.1535 387.902 36.6541V8.04785H374.815V80.4641H387.703ZM412.178 55.7584C412.178 64.7605 406.784 69.7616 399.99 69.7616C393.297 69.7616 387.703 64.6606 387.703 55.7584C387.703 46.7564 393.297 41.8554 399.99 41.8554C406.784 41.8554 412.178 46.7564 412.178 55.7584Z"
fill=
"white"
/>
<path
d=
"M432.99 67.0609C432.99 74.7627 439.383 81.8643 449.873 81.8643C457.165 81.8643 461.862 78.4634 464.358 74.5625C464.358 76.463 464.559 79.1635 464.858 80.4639H477.046C476.748 78.7635 476.448 75.2627 476.448 72.6622V48.4567C476.448 38.5545 470.653 29.7527 455.068 29.7527C441.881 29.7527 434.788 38.2544 433.989 45.9562L445.776 48.4567C446.177 44.1558 449.374 40.455 455.167 40.455C460.763 40.455 463.46 43.3556 463.46 46.8564C463.46 48.5568 462.561 49.9572 459.763 50.3572L447.676 52.1576C439.484 53.3579 432.99 58.2589 432.99 67.0609ZM452.671 71.962C448.375 71.962 446.276 69.1614 446.276 66.2608C446.276 62.4599 448.973 60.5594 452.371 60.0594L463.46 58.359V60.5594C463.46 69.2615 458.265 71.962 452.671 71.962Z"
fill=
"white"
/>
<path
d=
"M485.645 66.7608C486.243 72.3621 491.339 81.9642 506.124 81.9642C519.012 81.9642 525.205 73.7624 525.205 65.7607C525.205 58.559 520.311 52.6577 510.62 50.6571L503.626 49.1569C500.929 48.6568 499.132 47.1565 499.132 44.7559C499.132 41.9552 501.928 39.8549 505.425 39.8549C511.021 39.8549 513.118 43.5556 513.519 46.4564L524.607 43.9558C524.007 38.6546 519.312 29.7527 505.326 29.7527C494.735 29.7527 486.944 37.0543 486.944 45.8561C486.944 52.7576 491.238 58.4591 500.73 60.5594L507.224 62.0598C511.021 62.8599 512.519 64.6605 512.519 66.8609C512.519 69.4615 510.421 71.762 506.025 71.762C500.23 71.762 497.334 68.1611 497.034 64.2602L485.645 66.7608Z"
fill=
"white"
/>
<path
d=
"M545.385 50.2571C545.685 45.7562 549.482 40.5549 556.375 40.5549C563.967 40.5549 567.165 45.3561 567.365 50.2571H545.385ZM568.664 63.0601C567.065 67.4609 563.668 70.5617 557.474 70.5617C550.88 70.5617 545.385 65.8606 545.087 59.3593H580.252C580.252 59.159 580.451 57.1587 580.451 55.2582C580.451 39.4547 571.361 29.7527 556.175 29.7527C543.588 29.7527 531.998 39.9548 531.998 55.6584C531.998 72.262 543.886 81.9642 557.374 81.9642C569.462 81.9642 577.255 74.8626 579.753 66.3607L568.664 63.0601Z"
fill=
"white"
/>
<path
d=
"M63.7076 110.284C60.8481 113.885 55.0502 111.912 54.9813 107.314L53.9738 40.0627L99.1935 40.0627C107.384 40.0627 111.952 49.5228 106.859 55.9374L63.7076 110.284Z"
fill=
"url(#paint0_linear)"
/>
<path
d=
"M63.7076 110.284C60.8481 113.885 55.0502 111.912 54.9813 107.314L53.9738 40.0627L99.1935 40.0627C107.384 40.0627 111.952 49.5228 106.859 55.9374L63.7076 110.284Z"
fill=
"url(#paint1_linear)"
fill-opacity=
"0.2"
/>
<path
d=
"M45.317 2.07103C48.1765 -1.53037 53.9745 0.442937 54.0434 5.041L54.4849 72.2922H9.83113C1.64038 72.2922 -2.92775 62.8321 2.1655 56.4175L45.317 2.07103Z"
fill=
"#3ECF8E"
/>
<defs>
<linearGradient
id=
"paint0_linear"
x1=
"53.9738"
y1=
"54.974"
x2=
"94.1635"
y2=
"71.8295"
gradientUnits=
"userSpaceOnUse"
>
<stop
stop-color=
"#249361"
/>
<stop
offset=
"1"
stop-color=
"#3ECF8E"
/>
</linearGradient>
<linearGradient
id=
"paint1_linear"
x1=
"36.1558"
y1=
"30.578"
x2=
"54.4844"
y2=
"65.0806"
gradientUnits=
"userSpaceOnUse"
>
<stop/>
<stop
offset=
"1"
stop-opacity=
"0"
/>
</linearGradient>
</defs>
</svg>
assets/supabase/supabase-logo-wordmark--light.svg
0 → 100644
浏览文件 @
1d0176d1
<svg
width=
"581"
height=
"113"
viewBox=
"0 0 581 113"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<path
d=
"M151.397 66.7608C151.996 72.3621 157.091 81.9642 171.877 81.9642C184.764 81.9642 190.959 73.7624 190.959 65.7607C190.959 58.559 186.063 52.6577 176.373 50.6571L169.379 49.1569C166.682 48.6568 164.884 47.1565 164.884 44.7559C164.884 41.9552 167.681 39.8549 171.178 39.8549C176.772 39.8549 178.87 43.5556 179.27 46.4564L190.359 43.9558C189.76 38.6546 185.064 29.7527 171.078 29.7527C160.488 29.7527 152.696 37.0543 152.696 45.8561C152.696 52.7576 156.991 58.4591 166.482 60.5594L172.976 62.0598C176.772 62.8599 178.271 64.6605 178.271 66.8609C178.271 69.4615 176.173 71.762 171.777 71.762C165.983 71.762 163.085 68.1611 162.786 64.2602L151.397 66.7608Z"
fill=
"#1F1F1F"
/>
<path
d=
"M233.421 80.4639H246.109C245.909 78.7635 245.609 75.3628 245.609 71.5618V31.2529H232.321V59.8592C232.321 65.5606 228.925 69.5614 223.031 69.5614C216.837 69.5614 214.039 65.1604 214.039 59.6592V31.2529H200.752V62.3599C200.752 73.0622 207.545 81.7642 219.434 81.7642C224.628 81.7642 230.325 79.7638 233.022 75.1627C233.022 77.1631 233.221 79.4636 233.421 80.4639Z"
fill=
"#1F1F1F"
/>
<path
d=
"M273.076 99.4682V75.663C275.473 78.9636 280.469 81.6644 287.263 81.6644C301.149 81.6644 310.439 70.6617 310.439 55.7584C310.439 41.1553 302.148 30.1528 287.762 30.1528C280.37 30.1528 274.875 33.4534 272.677 37.2544V31.253H259.79V99.4682H273.076ZM297.352 55.8585C297.352 64.6606 291.958 69.7616 285.164 69.7616C278.372 69.7616 272.877 64.5605 272.877 55.8585C272.877 47.1566 278.372 42.0554 285.164 42.0554C291.958 42.0554 297.352 47.1566 297.352 55.8585Z"
fill=
"#1F1F1F"
/>
<path
d=
"M317.964 67.0609C317.964 74.7627 324.357 81.8643 334.848 81.8643C342.139 81.8643 346.835 78.4634 349.332 74.5625C349.332 76.463 349.532 79.1635 349.832 80.4639H362.02C361.72 78.7635 361.422 75.2627 361.422 72.6622V48.4567C361.422 38.5545 355.627 29.7527 340.043 29.7527C326.855 29.7527 319.761 38.2544 318.963 45.9562L330.751 48.4567C331.151 44.1558 334.348 40.455 340.141 40.455C345.737 40.455 348.434 43.3556 348.434 46.8564C348.434 48.5568 347.536 49.9572 344.738 50.3572L332.65 52.1576C324.458 53.3579 317.964 58.2589 317.964 67.0609ZM337.644 71.962C333.349 71.962 331.25 69.1614 331.25 66.2608C331.25 62.4599 333.947 60.5594 337.345 60.0594L348.434 58.359V60.5594C348.434 69.2615 343.239 71.962 337.644 71.962Z"
fill=
"#1F1F1F"
/>
<path
d=
"M387.703 80.4641V74.4627C390.299 78.6637 395.494 81.6644 402.288 81.6644C416.276 81.6644 425.467 70.5618 425.467 55.6585C425.467 41.0552 417.174 29.9528 402.788 29.9528C395.494 29.9528 390.1 33.1535 387.902 36.6541V8.04785H374.815V80.4641H387.703ZM412.178 55.7584C412.178 64.7605 406.784 69.7616 399.99 69.7616C393.297 69.7616 387.703 64.6606 387.703 55.7584C387.703 46.7564 393.297 41.8554 399.99 41.8554C406.784 41.8554 412.178 46.7564 412.178 55.7584Z"
fill=
"#1F1F1F"
/>
<path
d=
"M432.99 67.0609C432.99 74.7627 439.383 81.8643 449.873 81.8643C457.165 81.8643 461.862 78.4634 464.358 74.5625C464.358 76.463 464.559 79.1635 464.858 80.4639H477.046C476.748 78.7635 476.448 75.2627 476.448 72.6622V48.4567C476.448 38.5545 470.653 29.7527 455.068 29.7527C441.881 29.7527 434.788 38.2544 433.989 45.9562L445.776 48.4567C446.177 44.1558 449.374 40.455 455.167 40.455C460.763 40.455 463.46 43.3556 463.46 46.8564C463.46 48.5568 462.561 49.9572 459.763 50.3572L447.676 52.1576C439.484 53.3579 432.99 58.2589 432.99 67.0609ZM452.671 71.962C448.375 71.962 446.276 69.1614 446.276 66.2608C446.276 62.4599 448.973 60.5594 452.371 60.0594L463.46 58.359V60.5594C463.46 69.2615 458.265 71.962 452.671 71.962Z"
fill=
"#1F1F1F"
/>
<path
d=
"M485.645 66.7608C486.243 72.3621 491.339 81.9642 506.124 81.9642C519.012 81.9642 525.205 73.7624 525.205 65.7607C525.205 58.559 520.311 52.6577 510.62 50.6571L503.626 49.1569C500.929 48.6568 499.132 47.1565 499.132 44.7559C499.132 41.9552 501.928 39.8549 505.425 39.8549C511.021 39.8549 513.118 43.5556 513.519 46.4564L524.607 43.9558C524.007 38.6546 519.312 29.7527 505.326 29.7527C494.735 29.7527 486.944 37.0543 486.944 45.8561C486.944 52.7576 491.238 58.4591 500.73 60.5594L507.224 62.0598C511.021 62.8599 512.519 64.6605 512.519 66.8609C512.519 69.4615 510.421 71.762 506.025 71.762C500.23 71.762 497.334 68.1611 497.034 64.2602L485.645 66.7608Z"
fill=
"#1F1F1F"
/>
<path
d=
"M545.385 50.2571C545.685 45.7562 549.482 40.5549 556.375 40.5549C563.967 40.5549 567.165 45.3561 567.365 50.2571H545.385ZM568.664 63.0601C567.065 67.4609 563.668 70.5617 557.474 70.5617C550.88 70.5617 545.385 65.8606 545.087 59.3593H580.252C580.252 59.159 580.451 57.1587 580.451 55.2582C580.451 39.4547 571.361 29.7527 556.175 29.7527C543.588 29.7527 531.998 39.9548 531.998 55.6584C531.998 72.262 543.886 81.9642 557.374 81.9642C569.462 81.9642 577.255 74.8626 579.753 66.3607L568.664 63.0601Z"
fill=
"#1F1F1F"
/>
<path
d=
"M63.7076 110.284C60.8481 113.885 55.0502 111.912 54.9813 107.314L53.9738 40.0627L99.1935 40.0627C107.384 40.0627 111.952 49.5228 106.859 55.9374L63.7076 110.284Z"
fill=
"url(#paint0_linear)"
/>
<path
d=
"M63.7076 110.284C60.8481 113.885 55.0502 111.912 54.9813 107.314L53.9738 40.0627L99.1935 40.0627C107.384 40.0627 111.952 49.5228 106.859 55.9374L63.7076 110.284Z"
fill=
"url(#paint1_linear)"
fill-opacity=
"0.2"
/>
<path
d=
"M45.317 2.07103C48.1765 -1.53037 53.9745 0.442937 54.0434 5.041L54.4849 72.2922H9.83113C1.64038 72.2922 -2.92775 62.8321 2.1655 56.4175L45.317 2.07103Z"
fill=
"#3ECF8E"
/>
<defs>
<linearGradient
id=
"paint0_linear"
x1=
"53.9738"
y1=
"54.974"
x2=
"94.1635"
y2=
"71.8295"
gradientUnits=
"userSpaceOnUse"
>
<stop
stop-color=
"#249361"
/>
<stop
offset=
"1"
stop-color=
"#3ECF8E"
/>
</linearGradient>
<linearGradient
id=
"paint1_linear"
x1=
"36.1558"
y1=
"30.578"
x2=
"54.4844"
y2=
"65.0806"
gradientUnits=
"userSpaceOnUse"
>
<stop/>
<stop
offset=
"1"
stop-opacity=
"0"
/>
</linearGradient>
</defs>
</svg>
src/components/GitHubConnector.tsx
浏览文件 @
1d0176d1
...
...
@@ -173,11 +173,11 @@ export function GitHubConnector({ appId, folderName }: GitHubConnectorProps) {
if
(
!
settings
?.
githubAccessToken
)
{
return
(
<
div
className=
"mt-
4
w-full"
>
<
div
className=
"mt-
1
w-full"
>
{
" "
}
<
Button
onClick=
{
handleConnectToGithub
}
className=
"cursor-pointer w-full py-
6 flex justify-center items-center gap-2 text-lg
"
className=
"cursor-pointer w-full py-
5 flex justify-center items-center gap-2
"
size=
"lg"
variant=
"outline"
disabled=
{
isConnectingToGithub
||
!
appId
}
// Also disable if appId is null
...
...
src/components/SupabaseConnector.tsx
浏览文件 @
1d0176d1
...
...
@@ -25,13 +25,19 @@ import { Skeleton } from "@/components/ui/skeleton";
import
{
useLoadApp
}
from
"@/hooks/useLoadApp"
;
import
{
useDeepLink
}
from
"@/contexts/DeepLinkContext"
;
const
OAUTH_CLIENT_ID
=
"bf747de7-60bb-48a2-9015-6494e0b04983"
;
import
supabaseLogoLight
from
"../../assets/supabase/supabase-logo-wordmark--light.svg"
;
import
supabaseLogoDark
from
"../../assets/supabase/supabase-logo-wordmark--dark.svg"
;
import
connectSupabaseDark
from
"../../assets/supabase/connect-supabase-dark.svg"
;
import
connectSupabaseLight
from
"../../assets/supabase/connect-supabase-light.svg"
;
import
{
ExternalLink
}
from
"lucide-react"
;
import
{
useTheme
}
from
"@/contexts/ThemeContext"
;
export
function
SupabaseConnector
({
appId
}:
{
appId
:
number
})
{
const
[
isConnecting
,
setIsConnecting
]
=
useState
(
false
);
const
{
settings
,
refreshSettings
}
=
useSettings
();
const
{
app
,
refreshApp
}
=
useLoadApp
(
appId
);
const
{
lastDeepLink
}
=
useDeepLink
();
const
{
isDarkMode
}
=
useTheme
();
useEffect
(()
=>
{
const
handleDeepLink
=
async
()
=>
{
if
(
lastDeepLink
?.
type
===
"supabase-oauth-return"
)
{
...
...
@@ -58,27 +64,6 @@ export function SupabaseConnector({ appId }: { appId: number }) {
}
},
[
settings
?.
supabase
?.
accessToken
,
loadProjects
]);
const
handleConnect
=
async
()
=>
{
try
{
setIsConnecting
(
true
);
// TODO: replace this with deployed URL
const
result
=
await
IpcClient
.
getInstance
().
openExternalUrl
(
"https://supabase-oauth.dyad.sh/api/connect-supabase/login"
);
if
(
!
result
.
success
)
{
throw
new
Error
(
result
.
error
||
"Failed to open auth URL"
);
}
toast
.
success
(
"Successfully connected to Supabase"
);
}
catch
(
error
)
{
console
.
error
(
"Failed to connect to Supabase:"
,
error
);
toast
.
error
(
"Failed to connect to Supabase"
);
}
finally
{
setIsConnecting
(
false
);
}
};
const
handleProjectSelect
=
async
(
projectId
:
string
)
=>
{
try
{
await
setAppProject
(
projectId
,
appId
);
...
...
@@ -103,9 +88,31 @@ export function SupabaseConnector({ appId }: { appId: number }) {
if
(
settings
?.
supabase
?.
accessToken
)
{
if
(
app
?.
supabaseProjectName
)
{
return
(
<
Card
>
<
Card
className=
"mt-1"
>
<
CardHeader
>
<
CardTitle
>
Supabase Project
</
CardTitle
>
<
CardTitle
className=
"flex items-center justify-between"
>
Supabase Project
{
" "
}
<
Button
variant=
"outline"
onClick=
{
()
=>
{
IpcClient
.
getInstance
().
openExternalUrl
(
`https://supabase.com/dashboard/project/${app.supabaseProjectId}`
);
}
}
className=
"ml-2 px-2 py-1"
style=
{
{
display
:
"inline-flex"
,
alignItems
:
"center"
}
}
asChild
>
<
div
className=
"flex items-center gap-2"
>
<
img
src=
{
isDarkMode
?
supabaseLogoDark
:
supabaseLogoLight
}
alt=
"Supabase Logo"
style=
{
{
height
:
20
,
width
:
"auto"
,
marginRight
:
4
}
}
/>
<
ExternalLink
className=
"h-4 w-4"
/>
</
div
>
</
Button
>
</
CardTitle
>
<
CardDescription
>
This app is connected to project:
{
app
.
supabaseProjectName
}
</
CardDescription
>
...
...
@@ -119,7 +126,7 @@ export function SupabaseConnector({ appId }: { appId: number }) {
);
}
return
(
<
Card
>
<
Card
className=
"mt-1"
>
<
CardHeader
>
<
CardTitle
>
Supabase Projects
</
CardTitle
>
<
CardDescription
>
...
...
@@ -188,15 +195,20 @@ export function SupabaseConnector({ appId }: { appId: number }) {
return
(
<
div
className=
"flex flex-col space-y-4 p-4 border rounded-md"
>
<
h2
className=
"text-lg font-semibold"
>
Supabase Integration
</
h2
>
<
Button
onClick=
{
handleConnect
}
disabled=
{
isConnecting
}
className=
"w-full"
>
{
isConnecting
?
"Connecting..."
:
"Connect to Supabase"
}
</
Button
>
<
div
className=
"flex flex-col md:flex-row items-center justify-between"
>
<
h2
className=
"text-lg font-medium"
>
Integrations
</
h2
>
<
img
onClick=
{
()
=>
{
IpcClient
.
getInstance
().
openExternalUrl
(
"https://supabase-oauth.dyad.sh/api/connect-supabase/login"
);
}
}
src=
{
isDarkMode
?
connectSupabaseDark
:
connectSupabaseLight
}
alt=
"Connect to Supabase"
className=
"w-full h-10 min-h-8 min-w-20 cursor-pointer"
// className="h-10"
/>
</
div
>
</
div
>
);
}
src/components/chat/CodeHighlight.tsx
浏览文件 @
1d0176d1
...
...
@@ -17,28 +17,7 @@ export const CodeHighlight = memo(
const
language
=
className
?.
match
(
/language-
(\w
+
)
/
)?.[
1
];
const
isInline
=
node
?
isInlineCode
(
node
)
:
false
;
// Get the current theme setting
const
{
theme
}
=
useTheme
();
// State to track if dark mode is active
const
[
isDarkMode
,
setIsDarkMode
]
=
React
.
useState
(
false
);
// Determine if dark mode is active when component mounts or theme changes
useEffect
(()
=>
{
const
darkModeQuery
=
window
.
matchMedia
(
"(prefers-color-scheme: dark)"
);
const
updateTheme
=
()
=>
{
setIsDarkMode
(
theme
===
"dark"
||
(
theme
===
"system"
&&
darkModeQuery
.
matches
)
);
};
updateTheme
();
darkModeQuery
.
addEventListener
(
"change"
,
updateTheme
);
return
()
=>
{
darkModeQuery
.
removeEventListener
(
"change"
,
updateTheme
);
};
},
[
theme
]);
const
{
isDarkMode
}
=
useTheme
();
// Cache for the highlighted code
const
highlightedCodeCache
=
useRef
<
ReactNode
|
null
>
(
null
);
...
...
src/contexts/ThemeContext.tsx
浏览文件 @
1d0176d1
...
...
@@ -53,5 +53,24 @@ export function useTheme() {
if
(
context
===
undefined
)
{
throw
new
Error
(
"useTheme must be used within a ThemeProvider"
);
}
return
context
;
const
[
isDarkMode
,
setIsDarkMode
]
=
useState
(
false
);
const
{
theme
,
setTheme
}
=
context
;
// Determine if dark mode is active when component mounts or theme changes
useEffect
(()
=>
{
const
darkModeQuery
=
window
.
matchMedia
(
"(prefers-color-scheme: dark)"
);
const
updateTheme
=
()
=>
{
setIsDarkMode
(
theme
===
"dark"
||
(
theme
===
"system"
&&
darkModeQuery
.
matches
)
);
};
updateTheme
();
darkModeQuery
.
addEventListener
(
"change"
,
updateTheme
);
return
()
=>
{
darkModeQuery
.
removeEventListener
(
"change"
,
updateTheme
);
};
},
[
theme
]);
return
{
theme
,
isDarkMode
,
setTheme
};
}
src/pages/app-details.tsx
浏览文件 @
1d0176d1
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论