diff --git a/src/components/ui/IconButton.tsx b/src/components/ui/IconButton.tsx index 207332a7..9c11b92c 100644 --- a/src/components/ui/IconButton.tsx +++ b/src/components/ui/IconButton.tsx @@ -1,6 +1,7 @@ import styled, { css } from "styled-components"; interface Props { + rotate?: string; type?: "default" | "circle"; } @@ -22,6 +23,10 @@ export default styled.div` color: ${normal}; } + svg { + transition: 0.2s ease transform; + } + &:hover { fill: ${hover}; color: ${hover}; @@ -43,4 +48,10 @@ export default styled.div` background-color: var(--primary-header); } `} + + ${(props) => props.rotate && css` + svg { + transform: rotateZ(${props.rotate}); + } + ` } `; diff --git a/src/context/revoltjs/FileUploads.tsx b/src/context/revoltjs/FileUploads.tsx index 1aba0317..83cf8a4a 100644 --- a/src/context/revoltjs/FileUploads.tsx +++ b/src/context/revoltjs/FileUploads.tsx @@ -276,14 +276,9 @@ export function FileUploader(props: Props) { if (uploading) return cancel(); if (attached) return remove(); onClick(); - }}> - {uploading ? ( - - ) : attached ? ( - - ) : ( - - )} + }} + rotate={uploading || attached ? '45deg' : undefined}> + ); }