Connect, collaborate, and grow with a community of TypeScript developers
feat: aot badges (#1138)
Eric Lee1d300d03c690
diff --git a/apps/web/src/app/[locale]/(profile)/[username]/_components/badges/aot-2023-badge.tsx b/apps/web/src/app/[locale]/(profile)/[username]/_components/badges/aot-2023-badge.tsxnew file mode 100644index 00000000..9c9a6ab7--- /dev/null+++ b/apps/web/src/app/[locale]/(profile)/[username]/_components/badges/aot-2023-badge.tsx@@ -0,0 +1,280 @@+export function HolidayBronzeBadge({ className }: { className?: string }) {+ return (+ <svg+ className={className}+ width="250"+ height="250"+ viewBox="0 0 250 250"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ >+ <mask+ id="mask0_16_29"+ style={{ maskType: 'alpha' }}+ maskUnits="userSpaceOnUse"+ x="16"+ y="3"+ width="218"+ height="244"+ >+ <path+ d="M112.5 7.21688C120.235 2.75106 129.765 2.75106 137.5 7.21688L220.753 55.2831C228.488 59.7489 233.253 68.0021 233.253 76.9338V173.066C233.253 181.998 228.488 190.251 220.753 194.717L137.5 242.783C129.765 247.249 120.235 247.249 112.5 242.783L29.2468 194.717C21.5118 190.251 16.7468 181.998 16.7468 173.066V76.9338C16.7468 68.0021 21.5118 59.7489 29.2468 55.2831L112.5 7.21688Z"+ fill="black"+ />+ </mask>+ <g mask="url(#mask0_16_29)">+ <rect width="250" height="250" fill="#D9D9D9" />+ <rect width="250" height="250" fill="url(#paint0_linear_16_29)" />+ <path+ d="M74.3309 80.3861L92.2816 71.0789L110.232 80.3861L106.8 60.6722L121.326 46.7073L101.257 43.8349L92.2816 25.899L83.3068 43.8349L63.2314 46.7073L77.7586 60.6722L74.3309 80.3861Z"+ fill="white"+ fill-opacity="0.62"+ />+ <path+ d="M152.246 217.662L45.0404 189.04L29.4744 224.046L172 262.101L152.246 217.662Z"+ fill="white"+ fill-opacity="0.62"+ />+ <path+ d="M123.966 154.044L67.3196 138.92L51.7542 173.926L143.72 198.488L123.966 154.044Z"+ fill="white"+ fill-opacity="0.62"+ />+ <path+ d="M74.034 123.81L115.44 134.864L92.2816 82.7655L74.034 123.81Z"+ fill="white"+ fill-opacity="0.62"+ />+ <path+ d="M232 187.682L225.182 187.682L214.409 174.659C213.693 173.795 213.023 173.057 212.398 172.443C211.761 171.818 211.108 171.341 210.437 171.011C209.767 170.67 209.023 170.5 208.205 170.5C207.307 170.5 206.54 170.693 205.903 171.08C205.267 171.455 204.778 171.977 204.437 172.648C204.085 173.318 203.909 174.091 203.909 174.966C203.909 175.841 204.085 176.614 204.437 177.284C204.79 177.943 205.307 178.455 205.989 178.818C206.67 179.182 207.5 179.364 208.477 179.364L208.477 188.364C206.023 188.364 203.909 187.812 202.136 186.71C200.364 185.608 199 184.051 198.045 182.04C197.091 180.028 196.614 177.67 196.614 174.966C196.614 172.17 197.062 169.75 197.96 167.705C198.847 165.648 200.097 164.062 201.71 162.949C203.324 161.824 205.216 161.261 207.386 161.261C208.727 161.261 210.062 161.54 211.392 162.097C212.71 162.653 214.17 163.653 215.773 165.097C217.375 166.54 219.284 168.591 221.5 171.25L224.227 174.523L224.432 174.523L224.432 160.886L232 160.886L232 187.682ZM232.955 141.446C232.943 144.616 232.21 147.355 230.756 149.662C229.301 151.969 227.205 153.747 224.466 154.997C221.727 156.247 218.443 156.866 214.614 156.855C210.773 156.844 207.511 156.219 204.83 154.98C202.148 153.73 200.108 151.957 198.71 149.662C197.312 147.355 196.614 144.616 196.614 141.446C196.614 138.276 197.318 135.537 198.727 133.23C200.125 130.923 202.165 129.145 204.847 127.895C207.528 126.645 210.784 126.026 214.614 126.037C218.466 126.037 221.761 126.662 224.5 127.912C227.239 129.162 229.335 130.94 230.79 133.247C232.233 135.543 232.955 138.276 232.955 141.446ZM225.25 141.446C225.25 139.81 224.398 138.469 222.693 137.423C220.977 136.366 218.284 135.844 214.614 135.855C212.216 135.855 210.256 136.094 208.733 136.571C207.21 137.048 206.085 137.707 205.358 138.548C204.619 139.389 204.25 140.355 204.25 141.446C204.25 143.082 205.08 144.418 206.739 145.452C208.398 146.486 211.023 147.014 214.614 147.037C217.057 147.048 219.068 146.815 220.648 146.338C222.216 145.861 223.375 145.202 224.125 144.361C224.875 143.509 225.25 142.537 225.25 141.446ZM232 121.588L225.182 121.588L214.409 108.565C213.693 107.702 213.023 106.963 212.398 106.349C211.761 105.724 211.108 105.247 210.437 104.918C209.767 104.577 209.023 104.406 208.205 104.406C207.307 104.406 206.54 104.599 205.903 104.986C205.267 105.361 204.778 105.884 204.437 106.554C204.085 107.224 203.909 107.997 203.909 108.872C203.909 109.747 204.085 110.52 204.437 111.19C204.79 111.849 205.307 112.361 205.989 112.724C206.67 113.088 207.5 113.27 208.477 113.27L208.477 122.27C206.023 122.27 203.909 121.719 202.136 120.616C200.364 119.514 199 117.957 198.045 115.946C197.091 113.935 196.614 111.577 196.614 108.872C196.614 106.077 197.062 103.656 197.96 101.611C198.847 99.554 200.097 97.9688 201.71 96.8551C203.324 95.7301 205.216 95.1676 207.386 95.1676C208.727 95.1676 210.062 95.446 211.392 96.0028C212.71 96.5597 214.17 97.5597 215.773 99.0028C217.375 100.446 219.284 102.497 221.5 105.156L224.227 108.429L224.432 108.429L224.432 94.7926L232 94.7926L232 121.588ZM232.477 76.9205C232.477 79.6705 232.006 82.1136 231.062 84.25C230.108 86.375 228.795 88.0455 227.125 89.2614C225.455 90.4773 223.534 91.0909 221.364 91.1023L221.364 81.5568C222.034 81.5455 222.636 81.3409 223.17 80.9432C223.693 80.5341 224.102 79.9773 224.398 79.2727C224.693 78.5682 224.841 77.7614 224.841 76.8523C224.841 75.9773 224.687 75.2045 224.381 74.5341C224.062 73.8636 223.625 73.3409 223.068 72.9659C222.511 72.5909 221.875 72.4091 221.159 72.4205C220.455 72.4091 219.83 72.625 219.284 73.0682C218.739 73.5 218.312 74.108 218.006 74.8921C217.699 75.6761 217.545 76.5796 217.545 77.6023L217.545 81.1477L211 81.1477L211 77.6023C211 76.6591 210.847 75.8296 210.54 75.1136C210.233 74.3864 209.807 73.8239 209.261 73.4261C208.716 73.0171 208.091 72.8182 207.386 72.8296C206.705 72.8182 206.102 72.983 205.58 73.3239C205.057 73.6648 204.648 74.1421 204.352 74.7557C204.057 75.358 203.909 76.0568 203.909 76.8523C203.909 77.7159 204.062 78.4886 204.369 79.1705C204.676 79.8409 205.102 80.3693 205.648 80.7557C206.193 81.1421 206.818 81.3409 207.523 81.3523L207.523 90.4205C205.386 90.4091 203.5 89.8239 201.864 88.6648C200.227 87.4943 198.943 85.8921 198.011 83.858C197.08 81.8239 196.614 79.4886 196.614 76.8523C196.614 74.2727 197.051 71.9943 197.926 70.0171C198.801 68.0284 200.006 66.4773 201.54 65.3636C203.062 64.2386 204.807 63.6818 206.773 63.6932C208.727 63.6705 210.33 64.3409 211.58 65.7046C212.83 67.0568 213.568 68.7727 213.795 70.8523L214.068 70.8523C214.375 68.0341 215.239 65.9148 216.659 64.4943C218.068 63.0739 219.841 62.375 221.977 62.3977C224.023 62.3864 225.835 63 227.415 64.2386C228.994 65.4659 230.233 67.1761 231.131 69.3693C232.028 71.5511 232.477 74.0682 232.477 76.9205Z"+ fill="white"+ fill-opacity="0.62"+ />+ </g>+ <defs>+ <linearGradient+ id="paint0_linear_16_29"+ x1="63.5081"+ y1="26.6204"+ x2="197.998"+ y2="210.54"+ gradientUnits="userSpaceOnUse"+ >+ <stop stop-color="#714F24" />+ <stop offset="0.5625" stop-color="#D27D13" />+ <stop offset="1" stop-color="#5E3D13" />+ </linearGradient>+ </defs>+ </svg>+ );+}++export function HolidaySilverBadge({ className }: { className?: string }) {+ return (+ <svg+ className={className}+ width="250"+ height="250"+ viewBox="0 0 250 250"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ >+ <mask+ id="mask0_13_495"+ style={{ maskType: 'alpha' }}+ maskUnits="userSpaceOnUse"+ x="16"+ y="3"+ width="218"+ height="244"+ >+ <path+ d="M112.5 7.21688C120.235 2.75106 129.765 2.75106 137.5 7.21688L220.753 55.2831C228.488 59.7489 233.253 68.0021 233.253 76.9338V173.066C233.253 181.998 228.488 190.251 220.753 194.717L137.5 242.783C129.765 247.249 120.235 247.249 112.5 242.783L29.2468 194.717C21.5118 190.251 16.7468 181.998 16.7468 173.066V76.9338C16.7468 68.0021 21.5118 59.7489 29.2468 55.2831L112.5 7.21688Z"+ fill="black"+ />+ </mask>+ <g mask="url(#mask0_13_495)">+ <rect width="250" height="250" fill="url(#paint0_linear_13_495)" />+ <path+ d="M74.3309 80.3861L92.2815 71.0789L110.232 80.3861L106.8 60.6722L121.326 46.7073L101.257 43.8349L92.2815 25.899L83.3068 43.8349L63.2314 46.7073L77.7586 60.6722L74.3309 80.3861Z"+ fill="white"+ fill-opacity="0.62"+ />+ <path+ d="M152.246 217.662L45.0404 189.04L29.4744 224.046L172 262.101L152.246 217.662Z"+ fill="white"+ fill-opacity="0.62"+ />+ <path+ d="M123.966 154.044L67.3196 138.92L51.7542 173.926L143.72 198.488L123.966 154.044Z"+ fill="white"+ fill-opacity="0.62"+ />+ <path+ d="M74.034 123.81L115.44 134.864L92.2816 82.7655L74.034 123.81Z"+ fill="white"+ fill-opacity="0.62"+ />+ <path+ d="M232 187.682L225.182 187.682L214.409 174.659C213.693 173.795 213.023 173.057 212.398 172.443C211.761 171.818 211.108 171.341 210.437 171.011C209.767 170.67 209.023 170.5 208.205 170.5C207.307 170.5 206.54 170.693 205.903 171.08C205.267 171.455 204.778 171.977 204.437 172.648C204.085 173.318 203.909 174.091 203.909 174.966C203.909 175.841 204.085 176.614 204.437 177.284C204.79 177.943 205.307 178.455 205.989 178.818C206.67 179.182 207.5 179.364 208.477 179.364L208.477 188.364C206.023 188.364 203.909 187.812 202.136 186.71C200.364 185.608 199 184.051 198.045 182.04C197.091 180.028 196.614 177.67 196.614 174.966C196.614 172.17 197.062 169.75 197.96 167.705C198.847 165.648 200.097 164.062 201.71 162.949C203.324 161.824 205.216 161.261 207.386 161.261C208.727 161.261 210.062 161.54 211.392 162.097C212.71 162.653 214.17 163.653 215.773 165.097C217.375 166.54 219.284 168.591 221.5 171.25L224.227 174.523L224.432 174.523L224.432 160.886L232 160.886L232 187.682ZM232.955 141.446C232.943 144.616 232.21 147.355 230.756 149.662C229.301 151.969 227.205 153.747 224.466 154.997C221.727 156.247 218.443 156.866 214.614 156.855C210.773 156.844 207.511 156.219 204.83 154.98C202.148 153.73 200.108 151.957 198.71 149.662C197.312 147.355 196.614 144.616 196.614 141.446C196.614 138.276 197.318 135.537 198.727 133.23C200.125 130.923 202.165 129.145 204.847 127.895C207.528 126.645 210.784 126.026 214.614 126.037C218.466 126.037 221.761 126.662 224.5 127.912C227.239 129.162 229.335 130.94 230.79 133.247C232.233 135.543 232.955 138.276 232.955 141.446ZM225.25 141.446C225.25 139.81 224.398 138.469 222.693 137.423C220.977 136.366 218.284 135.844 214.614 135.855C212.216 135.855 210.256 136.094 208.733 136.571C207.21 137.048 206.085 137.707 205.358 138.548C204.619 139.389 204.25 140.355 204.25 141.446C204.25 143.082 205.08 144.418 206.739 145.452C208.398 146.486 211.023 147.014 214.614 147.037C217.057 147.048 219.068 146.815 220.648 146.338C222.216 145.861 223.375 145.202 224.125 144.361C224.875 143.509 225.25 142.537 225.25 141.446ZM232 121.588L225.182 121.588L214.409 108.565C213.693 107.702 213.023 106.963 212.398 106.349C211.761 105.724 211.108 105.247 210.437 104.918C209.767 104.577 209.023 104.406 208.205 104.406C207.307 104.406 206.54 104.599 205.903 104.986C205.267 105.361 204.778 105.884 204.437 106.554C204.085 107.224 203.909 107.997 203.909 108.872C203.909 109.747 204.085 110.52 204.437 111.19C204.79 111.849 205.307 112.361 205.989 112.724C206.67 113.088 207.5 113.27 208.477 113.27L208.477 122.27C206.023 122.27 203.909 121.719 202.136 120.616C200.364 119.514 199 117.957 198.045 115.946C197.091 113.935 196.614 111.577 196.614 108.872C196.614 106.077 197.062 103.656 197.96 101.611C198.847 99.554 200.097 97.9688 201.71 96.8551C203.324 95.7301 205.216 95.1676 207.386 95.1676C208.727 95.1676 210.062 95.446 211.392 96.0028C212.71 96.5597 214.17 97.5597 215.773 99.0028C217.375 100.446 219.284 102.497 221.5 105.156L224.227 108.429L224.432 108.429L224.432 94.7926L232 94.7926L232 121.588ZM232.477 76.9205C232.477 79.6705 232.006 82.1136 231.062 84.25C230.108 86.375 228.795 88.0455 227.125 89.2614C225.455 90.4773 223.534 91.0909 221.364 91.1023L221.364 81.5568C222.034 81.5455 222.636 81.3409 223.17 80.9432C223.693 80.5341 224.102 79.9773 224.398 79.2727C224.693 78.5682 224.841 77.7614 224.841 76.8523C224.841 75.9773 224.687 75.2045 224.381 74.5341C224.062 73.8636 223.625 73.3409 223.068 72.9659C222.511 72.5909 221.875 72.4091 221.159 72.4205C220.455 72.4091 219.83 72.625 219.284 73.0682C218.739 73.5 218.312 74.108 218.006 74.8921C217.699 75.6761 217.545 76.5796 217.545 77.6023L217.545 81.1477L211 81.1477L211 77.6023C211 76.6591 210.847 75.8296 210.54 75.1136C210.233 74.3864 209.807 73.8239 209.261 73.4261C208.716 73.0171 208.091 72.8182 207.386 72.8296C206.705 72.8182 206.102 72.983 205.58 73.3239C205.057 73.6648 204.648 74.1421 204.352 74.7557C204.057 75.358 203.909 76.0568 203.909 76.8523C203.909 77.7159 204.062 78.4886 204.369 79.1705C204.676 79.8409 205.102 80.3693 205.648 80.7557C206.193 81.1421 206.818 81.3409 207.523 81.3523L207.523 90.4205C205.386 90.4091 203.5 89.8239 201.864 88.6648C200.227 87.4943 198.943 85.8921 198.011 83.858C197.08 81.8239 196.614 79.4886 196.614 76.8523C196.614 74.2727 197.051 71.9943 197.926 70.0171C198.801 68.0284 200.006 66.4773 201.54 65.3636C203.062 64.2386 204.807 63.6818 206.773 63.6932C208.727 63.6705 210.33 64.3409 211.58 65.7046C212.83 67.0568 213.568 68.7727 213.795 70.8523L214.068 70.8523C214.375 68.0341 215.239 65.9148 216.659 64.4943C218.068 63.0739 219.841 62.375 221.977 62.3977C224.023 62.3864 225.835 63 227.415 64.2386C228.994 65.4659 230.233 67.1761 231.131 69.3693C232.028 71.5511 232.477 74.0682 232.477 76.9205Z"+ fill="white"+ fill-opacity="0.62"+ />+ </g>+ <defs>+ <linearGradient+ id="paint0_linear_13_495"+ x1="64.5161"+ y1="22.5694"+ x2="188.641"+ y2="215.658"+ gradientUnits="userSpaceOnUse"+ >+ <stop stop-color="#3D5954" />+ <stop offset="0.614583" stop-color="#9BCBC2" />+ <stop offset="1" stop-color="#48625D" />+ </linearGradient>+ </defs>+ </svg>+ );+}++export function HolidayGoldBadge({ className }: { className?: string }) {+ return (+ <svg+ className={className}+ width="250"+ height="250"+ viewBox="0 0 250 250"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ >+ <mask+ id="mask0_16_56"+ style={{ maskType: 'alpha' }}+ maskUnits="userSpaceOnUse"+ x="16"+ y="3"+ width="218"+ height="244"+ >+ <path+ d="M112.5 7.21688C120.235 2.75106 129.765 2.75106 137.5 7.21688L220.753 55.2831C228.488 59.7489 233.253 68.0021 233.253 76.9338V173.066C233.253 181.998 228.488 190.251 220.753 194.717L137.5 242.783C129.765 247.249 120.235 247.249 112.5 242.783L29.2468 194.717C21.5118 190.251 16.7468 181.998 16.7468 173.066V76.9338C16.7468 68.0021 21.5118 59.7489 29.2468 55.2831L112.5 7.21688Z"+ fill="black"+ />+ </mask>+ <g mask="url(#mask0_16_56)">+ <rect width="250" height="250" fill="url(#paint0_linear_16_56)" />+ <path+ d="M74.3309 80.3861L92.2816 71.0789L110.232 80.3861L106.8 60.6722L121.326 46.7073L101.257 43.8349L92.2816 25.899L83.3068 43.8349L63.2314 46.7073L77.7586 60.6722L74.3309 80.3861Z"+ fill="white"+ fill-opacity="0.62"+ />+ <path+ d="M152.246 217.662L45.0404 189.04L29.4744 224.046L172 262.101L152.246 217.662Z"+ fill="white"+ fill-opacity="0.62"+ />+ <path+ d="M123.966 154.044L67.3196 138.92L51.7542 173.926L143.72 198.488L123.966 154.044Z"+ fill="white"+ fill-opacity="0.62"+ />+ <path+ d="M74.0339 123.81L115.44 134.864L92.2815 82.7655L74.0339 123.81Z"+ fill="white"+ fill-opacity="0.62"+ />+ <path+ d="M232 187.682L225.182 187.682L214.409 174.659C213.693 173.795 213.023 173.057 212.398 172.443C211.761 171.818 211.108 171.341 210.437 171.011C209.767 170.67 209.023 170.5 208.205 170.5C207.307 170.5 206.54 170.693 205.903 171.08C205.267 171.455 204.778 171.977 204.437 172.648C204.085 173.318 203.909 174.091 203.909 174.966C203.909 175.841 204.085 176.614 204.437 177.284C204.79 177.943 205.307 178.455 205.989 178.818C206.67 179.182 207.5 179.364 208.477 179.364L208.477 188.364C206.023 188.364 203.909 187.812 202.136 186.71C200.364 185.608 199 184.051 198.045 182.04C197.091 180.028 196.614 177.67 196.614 174.966C196.614 172.17 197.062 169.75 197.96 167.705C198.847 165.648 200.097 164.062 201.71 162.949C203.324 161.824 205.216 161.261 207.386 161.261C208.727 161.261 210.062 161.54 211.392 162.097C212.71 162.653 214.17 163.653 215.773 165.097C217.375 166.54 219.284 168.591 221.5 171.25L224.227 174.523L224.432 174.523L224.432 160.886L232 160.886L232 187.682ZM232.955 141.446C232.943 144.616 232.21 147.355 230.756 149.662C229.301 151.969 227.205 153.747 224.466 154.997C221.727 156.247 218.443 156.866 214.614 156.855C210.773 156.844 207.511 156.219 204.83 154.98C202.148 153.73 200.108 151.957 198.71 149.662C197.312 147.355 196.614 144.616 196.614 141.446C196.614 138.276 197.318 135.537 198.727 133.23C200.125 130.923 202.165 129.145 204.847 127.895C207.528 126.645 210.784 126.026 214.614 126.037C218.466 126.037 221.761 126.662 224.5 127.912C227.239 129.162 229.335 130.94 230.79 133.247C232.233 135.543 232.955 138.276 232.955 141.446ZM225.25 141.446C225.25 139.81 224.398 138.469 222.693 137.423C220.977 136.366 218.284 135.844 214.614 135.855C212.216 135.855 210.256 136.094 208.733 136.571C207.21 137.048 206.085 137.707 205.358 138.548C204.619 139.389 204.25 140.355 204.25 141.446C204.25 143.082 205.08 144.418 206.739 145.452C208.398 146.486 211.023 147.014 214.614 147.037C217.057 147.048 219.068 146.815 220.648 146.338C222.216 145.861 223.375 145.202 224.125 144.361C224.875 143.509 225.25 142.537 225.25 141.446ZM232 121.588L225.182 121.588L214.409 108.565C213.693 107.702 213.023 106.963 212.398 106.349C211.761 105.724 211.108 105.247 210.437 104.918C209.767 104.577 209.023 104.406 208.205 104.406C207.307 104.406 206.54 104.599 205.903 104.986C205.267 105.361 204.778 105.884 204.437 106.554C204.085 107.224 203.909 107.997 203.909 108.872C203.909 109.747 204.085 110.52 204.437 111.19C204.79 111.849 205.307 112.361 205.989 112.724C206.67 113.088 207.5 113.27 208.477 113.27L208.477 122.27C206.023 122.27 203.909 121.719 202.136 120.616C200.364 119.514 199 117.957 198.045 115.946C197.091 113.935 196.614 111.577 196.614 108.872C196.614 106.077 197.062 103.656 197.96 101.611C198.847 99.554 200.097 97.9688 201.71 96.8551C203.324 95.7301 205.216 95.1676 207.386 95.1676C208.727 95.1676 210.062 95.446 211.392 96.0028C212.71 96.5597 214.17 97.5597 215.773 99.0028C217.375 100.446 219.284 102.497 221.5 105.156L224.227 108.429L224.432 108.429L224.432 94.7926L232 94.7926L232 121.588ZM232.477 76.9205C232.477 79.6705 232.006 82.1136 231.062 84.25C230.108 86.375 228.795 88.0455 227.125 89.2614C225.455 90.4773 223.534 91.0909 221.364 91.1023L221.364 81.5568C222.034 81.5455 222.636 81.3409 223.17 80.9432C223.693 80.5341 224.102 79.9773 224.398 79.2727C224.693 78.5682 224.841 77.7614 224.841 76.8523C224.841 75.9773 224.687 75.2045 224.381 74.5341C224.062 73.8636 223.625 73.3409 223.068 72.9659C222.511 72.5909 221.875 72.4091 221.159 72.4205C220.455 72.4091 219.83 72.625 219.284 73.0682C218.739 73.5 218.312 74.108 218.006 74.8921C217.699 75.6761 217.545 76.5796 217.545 77.6023L217.545 81.1477L211 81.1477L211 77.6023C211 76.6591 210.847 75.8296 210.54 75.1136C210.233 74.3864 209.807 73.8239 209.261 73.4261C208.716 73.0171 208.091 72.8182 207.386 72.8296C206.705 72.8182 206.102 72.983 205.58 73.3239C205.057 73.6648 204.648 74.1421 204.352 74.7557C204.057 75.358 203.909 76.0568 203.909 76.8523C203.909 77.7159 204.062 78.4886 204.369 79.1705C204.676 79.8409 205.102 80.3693 205.648 80.7557C206.193 81.1421 206.818 81.3409 207.523 81.3523L207.523 90.4205C205.386 90.4091 203.5 89.8239 201.864 88.6648C200.227 87.4943 198.943 85.8921 198.011 83.858C197.08 81.8239 196.614 79.4886 196.614 76.8523C196.614 74.2727 197.051 71.9943 197.926 70.0171C198.801 68.0284 200.006 66.4773 201.54 65.3636C203.062 64.2386 204.807 63.6818 206.773 63.6932C208.727 63.6705 210.33 64.3409 211.58 65.7046C212.83 67.0568 213.568 68.7727 213.795 70.8523L214.068 70.8523C214.375 68.0341 215.239 65.9148 216.659 64.4943C218.068 63.0739 219.841 62.375 221.977 62.3977C224.023 62.3864 225.835 63 227.415 64.2386C228.994 65.4659 230.233 67.1761 231.131 69.3693C232.028 71.5511 232.477 74.0682 232.477 76.9205Z"+ fill="white"+ fill-opacity="0.62"+ />+ </g>+ <defs>+ <linearGradient+ id="paint0_linear_16_56"+ x1="65.0202"+ y1="26.6204"+ x2="197.809"+ y2="209.652"+ gradientUnits="userSpaceOnUse"+ >+ <stop stop-color="#BC9B28" />+ <stop offset="0.619792" stop-color="#FFC700" />+ <stop offset="1" stop-color="#B59112" />+ </linearGradient>+ </defs>+ </svg>+ );+}++export function HolidayPlatinumBadge({ className }: { className?: string }) {+ return (+ <svg+ className={className}+ width="250"+ height="250"+ viewBox="0 0 250 250"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ >+ <mask+ id="mask0_16_74"+ style={{ maskType: 'alpha' }}+ maskUnits="userSpaceOnUse"+ x="16"+ y="3"+ width="218"+ height="244"+ >+ <path+ d="M112.5 7.21688C120.235 2.75106 129.765 2.75106 137.5 7.21688L220.753 55.2831C228.488 59.7489 233.253 68.0021 233.253 76.9338V173.066C233.253 181.998 228.488 190.251 220.753 194.717L137.5 242.783C129.765 247.249 120.235 247.249 112.5 242.783L29.2468 194.717C21.5118 190.251 16.7468 181.998 16.7468 173.066V76.9338C16.7468 68.0021 21.5118 59.7489 29.2468 55.2831L112.5 7.21688Z"+ fill="black"+ />+ </mask>+ <g mask="url(#mask0_16_74)">+ <rect width="250" height="250" fill="url(#paint0_linear_16_74)" />+ <path+ d="M74.3309 80.3861L92.2816 71.0789L110.232 80.3861L106.8 60.6722L121.326 46.7073L101.257 43.8349L92.2816 25.899L83.3068 43.8349L63.2314 46.7073L77.7586 60.6722L74.3309 80.3861Z"+ fill="white"+ fill-opacity="0.62"+ />+ <path+ d="M152.246 217.662L45.0404 189.04L29.4744 224.046L172 262.101L152.246 217.662Z"+ fill="white"+ fill-opacity="0.62"+ />+ <path+ d="M123.966 154.044L67.3196 138.92L51.7542 173.926L143.72 198.488L123.966 154.044Z"+ fill="white"+ fill-opacity="0.62"+ />+ <path+ d="M74.0339 123.81L115.44 134.864L92.2815 82.7655L74.0339 123.81Z"+ fill="white"+ fill-opacity="0.62"+ />+ <path+ d="M232 187.682L225.182 187.682L214.409 174.659C213.693 173.795 213.023 173.057 212.398 172.443C211.761 171.818 211.108 171.341 210.437 171.011C209.767 170.67 209.023 170.5 208.205 170.5C207.307 170.5 206.54 170.693 205.903 171.08C205.267 171.455 204.778 171.977 204.437 172.648C204.085 173.318 203.909 174.091 203.909 174.966C203.909 175.841 204.085 176.614 204.437 177.284C204.79 177.943 205.307 178.455 205.989 178.818C206.67 179.182 207.5 179.364 208.477 179.364L208.477 188.364C206.023 188.364 203.909 187.812 202.136 186.71C200.364 185.608 199 184.051 198.045 182.04C197.091 180.028 196.614 177.67 196.614 174.966C196.614 172.17 197.062 169.75 197.96 167.705C198.847 165.648 200.097 164.062 201.71 162.949C203.324 161.824 205.216 161.261 207.386 161.261C208.727 161.261 210.062 161.54 211.392 162.097C212.71 162.653 214.17 163.653 215.773 165.097C217.375 166.54 219.284 168.591 221.5 171.25L224.227 174.523L224.432 174.523L224.432 160.886L232 160.886L232 187.682ZM232.955 141.446C232.943 144.616 232.21 147.355 230.756 149.662C229.301 151.969 227.205 153.747 224.466 154.997C221.727 156.247 218.443 156.866 214.614 156.855C210.773 156.844 207.511 156.219 204.83 154.98C202.148 153.73 200.108 151.957 198.71 149.662C197.312 147.355 196.614 144.616 196.614 141.446C196.614 138.276 197.318 135.537 198.727 133.23C200.125 130.923 202.165 129.145 204.847 127.895C207.528 126.645 210.784 126.026 214.614 126.037C218.466 126.037 221.761 126.662 224.5 127.912C227.239 129.162 229.335 130.94 230.79 133.247C232.233 135.543 232.955 138.276 232.955 141.446ZM225.25 141.446C225.25 139.81 224.398 138.469 222.693 137.423C220.977 136.366 218.284 135.844 214.614 135.855C212.216 135.855 210.256 136.094 208.733 136.571C207.21 137.048 206.085 137.707 205.358 138.548C204.619 139.389 204.25 140.355 204.25 141.446C204.25 143.082 205.08 144.418 206.739 145.452C208.398 146.486 211.023 147.014 214.614 147.037C217.057 147.048 219.068 146.815 220.648 146.338C222.216 145.861 223.375 145.202 224.125 144.361C224.875 143.509 225.25 142.537 225.25 141.446ZM232 121.588L225.182 121.588L214.409 108.565C213.693 107.702 213.023 106.963 212.398 106.349C211.761 105.724 211.108 105.247 210.437 104.918C209.767 104.577 209.023 104.406 208.205 104.406C207.307 104.406 206.54 104.599 205.903 104.986C205.267 105.361 204.778 105.884 204.437 106.554C204.085 107.224 203.909 107.997 203.909 108.872C203.909 109.747 204.085 110.52 204.437 111.19C204.79 111.849 205.307 112.361 205.989 112.724C206.67 113.088 207.5 113.27 208.477 113.27L208.477 122.27C206.023 122.27 203.909 121.719 202.136 120.616C200.364 119.514 199 117.957 198.045 115.946C197.091 113.935 196.614 111.577 196.614 108.872C196.614 106.077 197.062 103.656 197.96 101.611C198.847 99.554 200.097 97.9688 201.71 96.8551C203.324 95.7301 205.216 95.1676 207.386 95.1676C208.727 95.1676 210.062 95.446 211.392 96.0028C212.71 96.5597 214.17 97.5597 215.773 99.0028C217.375 100.446 219.284 102.497 221.5 105.156L224.227 108.429L224.432 108.429L224.432 94.7926L232 94.7926L232 121.588ZM232.477 76.9205C232.477 79.6705 232.006 82.1136 231.062 84.25C230.108 86.375 228.795 88.0455 227.125 89.2614C225.455 90.4773 223.534 91.0909 221.364 91.1023L221.364 81.5568C222.034 81.5455 222.636 81.3409 223.17 80.9432C223.693 80.5341 224.102 79.9773 224.398 79.2727C224.693 78.5682 224.841 77.7614 224.841 76.8523C224.841 75.9773 224.687 75.2045 224.381 74.5341C224.062 73.8636 223.625 73.3409 223.068 72.9659C222.511 72.5909 221.875 72.4091 221.159 72.4205C220.455 72.4091 219.83 72.625 219.284 73.0682C218.739 73.5 218.312 74.108 218.006 74.8921C217.699 75.6761 217.545 76.5796 217.545 77.6023L217.545 81.1477L211 81.1477L211 77.6023C211 76.6591 210.847 75.8296 210.54 75.1136C210.233 74.3864 209.807 73.8239 209.261 73.4261C208.716 73.0171 208.091 72.8182 207.386 72.8296C206.705 72.8182 206.102 72.983 205.58 73.3239C205.057 73.6648 204.648 74.1421 204.352 74.7557C204.057 75.358 203.909 76.0568 203.909 76.8523C203.909 77.7159 204.062 78.4886 204.369 79.1705C204.676 79.8409 205.102 80.3693 205.648 80.7557C206.193 81.1421 206.818 81.3409 207.523 81.3523L207.523 90.4205C205.386 90.4091 203.5 89.8239 201.864 88.6648C200.227 87.4943 198.943 85.8921 198.011 83.858C197.08 81.8239 196.614 79.4886 196.614 76.8523C196.614 74.2727 197.051 71.9943 197.926 70.0171C198.801 68.0284 200.006 66.4773 201.54 65.3636C203.062 64.2386 204.807 63.6818 206.773 63.6932C208.727 63.6705 210.33 64.3409 211.58 65.7046C212.83 67.0568 213.568 68.7727 213.795 70.8523L214.068 70.8523C214.375 68.0341 215.239 65.9148 216.659 64.4943C218.068 63.0739 219.841 62.375 221.977 62.3977C224.023 62.3864 225.835 63 227.415 64.2386C228.994 65.4659 230.233 67.1761 231.131 69.3693C232.028 71.5511 232.477 74.0682 232.477 76.9205Z"+ fill="white"+ fill-opacity="0.62"+ />+ </g>+ <defs>+ <linearGradient+ id="paint0_linear_16_74"+ x1="75.1008"+ y1="21.412"+ x2="188.982"+ y2="212.197"+ gradientUnits="userSpaceOnUse"+ >+ <stop stop-color="#2EECEC" />+ <stop offset="0.677083" stop-color="#00A184" />+ <stop offset="1" stop-color="#0F7562" />+ </linearGradient>+ </defs>+ </svg>+ );+}diff --git a/apps/web/src/app/[locale]/(profile)/[username]/_components/dashboard/_actions.ts b/apps/web/src/app/[locale]/(profile)/[username]/_components/dashboard/_actions.tsindex 18f93a88..bef3291b 100644--- a/apps/web/src/app/[locale]/(profile)/[username]/_components/dashboard/_actions.ts+++ b/apps/web/src/app/[locale]/(profile)/[username]/_components/dashboard/_actions.ts@@ -154,3 +154,75 @@ export async function getSolvedChallenges(userId: string) {percentage,};}++export interface BadgeInfo {+ // eslint-disable-next-line @typescript-eslint/sort-type-constituents+ slug: 'aot-2023-bronze' | 'aot-2023-silver' | 'aot-2023-gold' | 'aot-2023-platinum';+ name: string;+}++export async function getBadges(userId: string): Promise<BadgeInfo[]> {+ const badges: BadgeInfo[] = [];++ const holidayTrack = await prisma.track.findFirstOrThrow({+ where: {+ slug: 'advent-of-typescript-2023',+ },+ include: {+ trackChallenges: {+ orderBy: {+ orderId: 'asc',+ },+ include: {+ challenge: {+ include: {+ submission: {+ where: {+ userId,+ },+ },+ },+ },+ },+ },+ enrolledUsers: {+ where: {+ id: userId,+ },+ select: {+ id: true,+ },+ },+ },+ });++ const numberOfInProgressHolidayChallenges = holidayTrack.trackChallenges.filter(+ (trackChallenge) => {+ return trackChallenge.challenge.submission?.every((submission) => !submission.isSuccessful);+ },+ ).length;++ if (numberOfInProgressHolidayChallenges > 0) {+ badges.push({ slug: 'aot-2023-bronze', name: 'Advent of TypeScript 2023 Bronze' });+ }++ const numberOfCompletedHolidayChallenges = holidayTrack.trackChallenges.filter(+ (trackChallenge) => {+ return trackChallenge.challenge.submission?.some((submission) => submission.isSuccessful);+ },+ ).length;++ if (numberOfCompletedHolidayChallenges >= 5) {+ badges.push({ slug: 'aot-2023-silver', name: 'Advent of TypeScript 2023 Silver' });+ }++ if (numberOfCompletedHolidayChallenges >= 15) {+ badges.push({ slug: 'aot-2023-gold', name: 'Advent of TypeScript 2023 Gold' });+ }++ if (numberOfCompletedHolidayChallenges >= 25) {+ badges.push({ slug: 'aot-2023-platinum', name: 'Advent of TypeScript 2023 Platinum' });+ }++ return badges;+}diff --git a/apps/web/src/app/[locale]/(profile)/[username]/_components/dashboard/badges.tsx b/apps/web/src/app/[locale]/(profile)/[username]/_components/dashboard/badges.tsxnew file mode 100644index 00000000..ce05442d--- /dev/null+++ b/apps/web/src/app/[locale]/(profile)/[username]/_components/dashboard/badges.tsx@@ -0,0 +1,57 @@+import { type FC } from 'react';++import { cn } from '@repo/ui/cn';+import { Text } from '@repo/ui/components/typography/typography';+import { Tooltip, TooltipContent, TooltipTrigger } from '@repo/ui/components/tooltip';++import { type BadgeInfo } from './_actions';+import {+ HolidayBronzeBadge,+ HolidayGoldBadge,+ HolidayPlatinumBadge,+ HolidaySilverBadge,+} from '../badges/aot-2023-badge';++const SlugToBadgeIcon: Record<BadgeInfo['slug'], FC<{ className: string }>> = {+ 'aot-2023-bronze': HolidayBronzeBadge,+ 'aot-2023-silver': HolidaySilverBadge,+ 'aot-2023-gold': HolidayGoldBadge,+ 'aot-2023-platinum': HolidayPlatinumBadge,+};++const Badge = ({ slug, name }: BadgeInfo) => {+ const Icon = SlugToBadgeIcon[slug];++ if (Icon === undefined) return null;++ return (+ <Tooltip>+ <TooltipTrigger asChild>+ <Icon className="h-12 w-12" />+ </TooltipTrigger>+ <TooltipContent side="bottom">+ <span>{name}</span>+ </TooltipContent>+ </Tooltip>+ );+};++interface BadgesProps {+ badges: BadgeInfo[];+ className?: string;+}++export const Badges = ({ badges, className }: BadgesProps) => {+ if (badges.length === 0) return null;++ return (+ <div className={cn('border-border flex flex-col gap-4 border-t py-4', className)}>+ <Text intent="leading">Badges</Text>+ <div className="flex flex-wrap gap-2">+ {badges.map((badge) => (+ <Badge key={badge.slug} {...badge} />+ ))}+ </div>+ </div>+ );+};diff --git a/apps/web/src/app/[locale]/(profile)/[username]/_components/dashboard/index.tsx b/apps/web/src/app/[locale]/(profile)/[username]/_components/dashboard/index.tsxindex 60c8d9ea..91e22cd1 100644--- a/apps/web/src/app/[locale]/(profile)/[username]/_components/dashboard/index.tsx+++ b/apps/web/src/app/[locale]/(profile)/[username]/_components/dashboard/index.tsx@@ -1,5 +1,7 @@'use client';+import { useEffect, useMemo } from 'react';import Link from 'next/link';+import { usePathname, useRouter } from 'next/navigation';import type { User } from '@repo/db/types';import { MagicIcon } from '@repo/ui/components/magic-icon';@@ -14,9 +16,9 @@ import { Bookmark, CheckCircle, ChevronRightSquare, Play, Settings, Text } fromimport { getRelativeTime } from '~/utils/relativeTime';import { stripProtocolAndWWW } from '~/utils/stringUtils';+import { type BadgeInfo } from './_actions';+import { Badges } from './badges';import UserHeader from './user-header';-import { useEffect, useMemo } from 'react';-import { usePathname, useRouter } from 'next/navigation';interface Props {// TODO: how do do this union type with just letting prisma halp@@ -24,11 +26,12 @@ interface Props {userLinks: { id: string | null; url: string }[];};isOwnProfile: boolean;+ badges: BadgeInfo[];children: React.ReactNode;}type Tab = 'bookmarks' | 'completed' | 'in-progress' | 'overview' | 'shared-solutions';-export function Dashboard({ user, isOwnProfile, children }: Props) {+export function Dashboard({ user, isOwnProfile, badges, children }: Props) {const router = useRouter();const tabs = useMemo(@@ -180,6 +183,7 @@ export function Dashboard({ user, isOwnProfile, children }: Props) {</>)}</div>+ <Badges className="flex w-full flex-1" badges={badges} /></div></VerticalTabsList><VerticalTabsContent className="shrink grow space-y-4" value={selectedTab}>diff --git a/apps/web/src/app/[locale]/(profile)/[username]/_components/profile.tsx b/apps/web/src/app/[locale]/(profile)/[username]/_components/profile.tsxindex 383e3bc3..531cc8d7 100644--- a/apps/web/src/app/[locale]/(profile)/[username]/_components/profile.tsx+++ b/apps/web/src/app/[locale]/(profile)/[username]/_components/profile.tsx@@ -3,6 +3,7 @@ import type { Metadata } from 'next';import { notFound } from 'next/navigation';import { Dashboard } from './dashboard';import { auth } from '@repo/auth/server';+import { getBadges } from './dashboard/_actions';interface Props {username: string;@@ -39,8 +40,10 @@ export async function Profile({ username: usernameFromQuery, children }: Props)const session = await auth();const isOwnProfile = session?.user.id === user.id;+ const badges = await getBadges(user.id);+return (- <Dashboard user={user} isOwnProfile={isOwnProfile}>+ <Dashboard user={user} isOwnProfile={isOwnProfile} badges={badges}>{children}</Dashboard>);diff --git a/packages/ui/src/icons.ts b/packages/ui/src/icons.tsindex 635df175..f5be67f9 100644--- a/packages/ui/src/icons.ts+++ b/packages/ui/src/icons.ts@@ -49,6 +49,7 @@ export {Settings2,Shapes,Share,+ Shield,Sparkle,Sparkles,SquareSlash,