Files
o2o-weather/frontend/src/b/svg.tsx
T

63 lines
2.3 KiB
TypeScript

type P = { className?: string }
const line = { fill: 'none', stroke: 'currentColor', strokeLinecap: 'round', strokeLinejoin: 'round' } as const
export function HeartIcon({ className }: P) {
return (
<svg viewBox="0 0 24 24" className={className} aria-hidden="true">
<path d="M12 20.5s-8-4.9-8-11A4.6 4.6 0 0 1 12 6.8a4.6 4.6 0 0 1 8 2.7c0 6.1-8 11-8 11z" />
</svg>
)
}
export function CommentIcon({ className }: P) {
return (
<svg viewBox="0 0 24 24" className={className} aria-hidden="true">
<path d="M20.5 12a8.5 8.5 0 0 1-12.6 7.4L3.5 20.5l1.2-4.2A8.5 8.5 0 1 1 20.5 12z" />
</svg>
)
}
export function SendIcon({ className }: P) {
return (
<svg viewBox="0 0 24 24" className={className} aria-hidden="true">
<path d="M21 3 10 14M21 3l-6.5 18-4-7.5L3 9.5z" />
</svg>
)
}
export function PinIcon({ className }: P) {
return (
<svg viewBox="0 0 24 24" {...line} strokeWidth="2.2" className={className} aria-hidden="true">
<path d="M12 21s7-6.2 7-11.5A7 7 0 0 0 5 9.5C5 14.8 12 21 12 21z" />
<circle cx="12" cy="9.5" r="2.5" />
</svg>
)
}
export function TabIcon({ name, className }: P & { name: 'today' | 'gak' | 'sky' | 'week' | 'season' | 'talk' }) {
return (
<svg viewBox="0 0 24 24" {...line} className={className} aria-hidden="true">
{name === 'today' && <path d="M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z" />}
{name === 'gak' && (
<>
<rect x="3.5" y="3.5" width="7" height="7" rx="2" />
<rect x="13.5" y="3.5" width="7" height="7" rx="2" />
<rect x="3.5" y="13.5" width="7" height="7" rx="2" />
<rect x="13.5" y="13.5" width="7" height="7" rx="2" />
</>
)}
{name === 'sky' && <path d="M3 18h18M6 14a6 6 0 0 1 12 0M12 4v3M4.9 7.9l2 2M19.1 7.9l-2 2M8 21h8" />}
{name === 'week' && (
<>
<rect x="3.5" y="5" width="17" height="15.5" rx="2.5" />
<path d="M3.5 10h17M8 3v4M16 3v4" />
<circle cx="12" cy="15" r="1.6" />
</>
)}
{name === 'talk' && <path d="M4 5.5A2.5 2.5 0 0 1 6.5 3h11A2.5 2.5 0 0 1 20 5.5v8a2.5 2.5 0 0 1-2.5 2.5H10l-4.5 4v-4h0A1.5 1.5 0 0 1 4 14.5zM8 8.5h8M8 12h5" />}
{name === 'season' && <path d="M12 6.5C10 5 7 4.5 3.5 5v14c3.5-.5 6.5 0 8.5 1.5 2-1.5 5-2 8.5-1.5V5C17 4.5 14 5 12 6.5zM12 6.5v14" />}
</svg>
)
}