App.styled.ts 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. import styled, { css } from 'styled-components';
  2. import { Link } from 'react-router-dom';
  3. import { Button } from './common/Button/Button';
  4. export const Layout = styled.div`
  5. min-width: 1200px;
  6. @media screen and (max-width: 1023px) {
  7. min-width: initial;
  8. }
  9. `;
  10. export const Container = styled.main(
  11. ({ theme }) => css`
  12. margin-top: ${theme.layout.navBarHeight};
  13. margin-left: ${theme.layout.navBarWidth};
  14. position: relative;
  15. padding-bottom: 30px;
  16. z-index: 20;
  17. @media screen and (max-width: 1023px) {
  18. margin-left: initial;
  19. }
  20. `
  21. );
  22. export const Sidebar = styled.div<{ $visible: boolean }>(
  23. ({ theme, $visible }) => css`
  24. width: ${theme.layout.navBarWidth};
  25. display: flex;
  26. flex-direction: column;
  27. border-right: 1px solid ${theme.layout.stuffBorderColor};
  28. position: fixed;
  29. top: ${theme.layout.navBarHeight};
  30. left: 0;
  31. bottom: 0;
  32. padding: 8px 16px;
  33. overflow-y: scroll;
  34. transition: width 0.25s, opacity 0.25s, transform 0.25s,
  35. -webkit-transform 0.25s;
  36. background: ${theme.menu.backgroundColor.normal};
  37. @media screen and (max-width: 1023px) {
  38. ${$visible &&
  39. `transform: translate3d(${theme.layout.navBarWidth}, 0, 0)`};
  40. left: -${theme.layout.navBarWidth};
  41. z-index: 100;
  42. }
  43. &::-webkit-scrollbar {
  44. width: 8px;
  45. }
  46. &::-webkit-scrollbar-track {
  47. background-color: ${theme.scrollbar.trackColor.normal};
  48. }
  49. &::-webkit-scrollbar-thumb {
  50. width: 8px;
  51. background-color: ${theme.scrollbar.thumbColor.normal};
  52. border-radius: 4px;
  53. }
  54. &:hover::-webkit-scrollbar-thumb {
  55. background: ${theme.scrollbar.thumbColor.active};
  56. }
  57. &:hover::-webkit-scrollbar-track {
  58. background-color: ${theme.scrollbar.trackColor.active};
  59. }
  60. `
  61. );
  62. export const Overlay = styled.div<{ $visible: boolean }>(
  63. ({ theme, $visible }) => css`
  64. height: calc(100vh - ${theme.layout.navBarHeight});
  65. z-index: 99;
  66. visibility: 'hidden';
  67. opacity: 0;
  68. -webkit-transition: all 0.5s ease;
  69. transition: all 0.5s ease;
  70. left: 0;
  71. position: absolute;
  72. top: 0;
  73. ${$visible &&
  74. css`
  75. @media screen and (max-width: 1023px) {
  76. bottom: 0;
  77. right: 0;
  78. visibility: 'visible';
  79. opacity: 1;
  80. background-color: ${theme.layout.overlay.backgroundColor};
  81. }
  82. `}
  83. `
  84. );
  85. export const Navbar = styled.nav(
  86. ({ theme }) => css`
  87. border-bottom: 1px solid ${theme.layout.stuffBorderColor};
  88. position: fixed;
  89. top: 0;
  90. left: 0;
  91. right: 0;
  92. z-index: 30;
  93. background-color: ${theme.menu.backgroundColor.normal};
  94. min-height: 3.25rem;
  95. `
  96. );
  97. export const NavbarBrand = styled.div`
  98. display: flex;
  99. justify-content: space-between;
  100. align-items: center !important;
  101. flex-shrink: 0;
  102. align-items: stretch;
  103. min-height: 3.25rem;
  104. `;
  105. export const NavbarItem = styled.div`
  106. display: flex;
  107. position: relative;
  108. flex-grow: 0;
  109. flex-shrink: 0;
  110. align-items: center;
  111. line-height: 1.5;
  112. padding: 0.5rem 0.75rem;
  113. `;
  114. export const NavbarBurger = styled.div(
  115. ({ theme }) => css`
  116. display: block;
  117. position: relative;
  118. cursor: pointer;
  119. height: 3.25rem;
  120. width: 3.25rem;
  121. margin: 0;
  122. padding: 0;
  123. &:hover {
  124. background-color: ${theme.menu.backgroundColor.hover};
  125. }
  126. @media screen and (min-width: 1024px) {
  127. display: none;
  128. }
  129. `
  130. );
  131. export const Span = styled.span(
  132. ({ theme }) => css`
  133. display: block;
  134. position: absolute;
  135. background: ${theme.menu.color.active};
  136. height: 1px;
  137. left: calc(50% - 8px);
  138. transform-origin: center;
  139. transition-duration: 86ms;
  140. transition-property: background-color, opacity, transform, -webkit-transform;
  141. transition-timing-function: ease-out;
  142. width: 16px;
  143. &:first-child {
  144. top: calc(50% - 6px);
  145. }
  146. &:nth-child(2) {
  147. top: calc(50% - 1px);
  148. }
  149. &:nth-child(3) {
  150. top: calc(50% + 4px);
  151. }
  152. `
  153. );
  154. export const Hyperlink = styled(Link)(
  155. ({ theme }) => css`
  156. position: relative;
  157. display: flex;
  158. flex-grow: 0;
  159. flex-shrink: 0;
  160. align-items: center;
  161. gap: 8px;
  162. margin: 0;
  163. padding: 0.5rem 0.75rem;
  164. font-family: Inter, sans-serif;
  165. font-style: normal;
  166. font-weight: bold;
  167. font-size: 12px;
  168. line-height: 16px;
  169. color: ${theme.menu.color.active};
  170. text-decoration: none;
  171. word-break: break-word;
  172. cursor: pointer;
  173. `
  174. );
  175. export const AlertsContainer = styled.div`
  176. max-width: 40%;
  177. width: 500px;
  178. position: fixed;
  179. bottom: 15px;
  180. right: 15px;
  181. z-index: 1000;
  182. @media screen and (max-width: 1023px) {
  183. max-width: initial;
  184. }
  185. `;
  186. export const LogoutButton = styled(Button)(
  187. ({ theme }) => css`
  188. color: ${theme.button.primary.invertedColors.normal};
  189. background: none !important;
  190. padding: 0 8px;
  191. `
  192. );
  193. export const LogoutLink = styled(Link)(
  194. () => css`
  195. margin-right: 16px;
  196. `
  197. );