Fix import paths in whole project

This commit is contained in:
Aarni Halinen
2019-07-03 01:04:59 +03:00
parent 18821d222c
commit d1f8408472
15 changed files with 127 additions and 132 deletions
-66
View File
@@ -37,69 +37,3 @@ $colors: (
@warn 'No specified hover color for '#{$label}'; add your own to _colors.scss';
@return lighten($color, 20%);
}
.color-div {
@mixin hoverableColor($colorName) {
&__#{$colorName} {
color: color($colorName);
}
&__#{$colorName}Hoverable {
&:hover,
&:active {
color: hover($colorName);
}
}
}
@mixin backgroundColor($colorName) {
&__background_#{$colorName} {
background-color: color($colorName);
}
&__background_#{$colorName}Hoverable {
&:hover,
&:active {
background-color: hover($colorName);
}
}
}
@mixin backgroundAndHoverableColor($colorName) {
@include hoverableColor($colorName);
@include backgroundColor($colorName);
}
@include backgroundAndHoverableColor(dark-blue);
@include backgroundAndHoverableColor(light-blue);
@include backgroundAndHoverableColor(white);
@include backgroundAndHoverableColor(black);
@include backgroundAndHoverableColor(grey1);
@include backgroundAndHoverableColor(grey2);
@include backgroundAndHoverableColor(orange1);
@include backgroundAndHoverableColor(orange2);
@include backgroundAndHoverableColor(blue);
@include backgroundAndHoverableColor(light-turquoise);
@include backgroundAndHoverableColor(green);
@include backgroundAndHoverableColor(sand);
&__inherit {
color: inherit;
}
&__transparent {
color: transparent;
}
&__inheritHoverable {
&:hover,
&:active {
color: inherit;
}
}
&__background_transparent {
background-color: transparent;
}
}
+1 -2
View File
@@ -1,7 +1,6 @@
import * as React from "react";
import "./AsideSection.scss";
import ColorDiv from "../ColorDiv";
import { ColorDivProps } from "../ColorDiv/ColorDiv";
import ColorDiv, { ColorDivProps } from "../ColorDiv/ColorDiv";
export interface AsideSectionProps {
className?: string;
+65
View File
@@ -1 +1,66 @@
@import "../../assets/scss/globals";
.color-div {
@mixin hoverableColor($colorName) {
&__#{$colorName} {
color: color($colorName);
}
&__#{$colorName}Hoverable {
&:hover,
&:active {
color: hover($colorName);
}
}
}
@mixin backgroundColor($colorName) {
&__background_#{$colorName} {
background-color: color($colorName);
}
&__background_#{$colorName}Hoverable {
&:hover,
&:active {
background-color: hover($colorName);
}
}
}
@mixin backgroundAndHoverableColor($colorName) {
@include hoverableColor($colorName);
@include backgroundColor($colorName);
}
@include backgroundAndHoverableColor(dark-blue);
@include backgroundAndHoverableColor(light-blue);
@include backgroundAndHoverableColor(white);
@include backgroundAndHoverableColor(black);
@include backgroundAndHoverableColor(grey1);
@include backgroundAndHoverableColor(grey2);
@include backgroundAndHoverableColor(orange1);
@include backgroundAndHoverableColor(orange2);
@include backgroundAndHoverableColor(blue);
@include backgroundAndHoverableColor(light-turquoise);
@include backgroundAndHoverableColor(green);
@include backgroundAndHoverableColor(sand);
&__inherit {
color: inherit;
}
&__transparent {
color: transparent;
}
&__inheritHoverable {
&:hover,
&:active {
color: inherit;
}
}
&__background_transparent {
background-color: transparent;
}
}
+40 -1
View File
@@ -1,6 +1,45 @@
import * as React from "react";
import "./ColorDiv.scss";
import { ColorEnum, getColor, getBgColor, getHoverColor, getBgHoverColor } from "../..";
export enum ColorEnum {
DarkBlue,
LightBlue,
White,
Black,
Grey1,
Grey2,
Orange1,
Orange2,
Blue,
LightTurquoise,
Green,
Sand,
Transparent,
Inherit,
}
const colors = new Map<ColorEnum, string>([
[ColorEnum.DarkBlue, "dark-blue"],
[ColorEnum.LightBlue, "light-blue"],
[ColorEnum.White, "white"],
[ColorEnum.Black, "black"],
[ColorEnum.Grey1, "grey1"],
[ColorEnum.Grey2, "grey2"],
[ColorEnum.Orange1, "orange1"],
[ColorEnum.Orange2, "orange2"],
[ColorEnum.Blue, "blue"],
[ColorEnum.LightTurquoise, "light-turquoise"],
[ColorEnum.Green, "green"],
[ColorEnum.Sand, "sand"],
[ColorEnum.Transparent, "transparent"],
[ColorEnum.Inherit, "inherit"]
]);
export const getColor = (color: ColorEnum): string => `color-div__${colors.get(color)}`;
export const getBgColor = (color: ColorEnum): string => `color-div__background_${colors.get(color)}`;
export const getHoverColor = (color: ColorEnum): string => `color-div__${colors.get(color)}Hoverable`;
export const getBgHoverColor = (color: ColorEnum): string => `color-div__background_${colors.get(color)}Hoverable`;
export interface ColorDivProps extends React.HTMLAttributes<HTMLDivElement> {
textColor?: ColorEnum;
@@ -1,7 +1,6 @@
import * as React from "react";
import "./HeroAsideSection.scss";
import ColorDiv from "../ColorDiv/index";
import { ColorDivProps } from "../ColorDiv/ColorDiv";
import ColorDiv, { ColorDivProps } from "../ColorDiv/ColorDiv";
export interface HeroAsideSectionProps { }
+1 -2
View File
@@ -1,7 +1,6 @@
import * as React from "react";
import "./MainSection.scss";
import ColorDiv from "../ColorDiv";
import { ColorDivProps } from "../ColorDiv/ColorDiv";
import ColorDiv, { ColorDivProps } from "../ColorDiv/ColorDiv";
export interface MainSectionProps { }
export interface MainSectionState { }
+1 -2
View File
@@ -1,7 +1,6 @@
import * as React from "react";
import "./PageSection.scss";
import ColorDiv from "../ColorDiv/index";
import { ColorDivProps } from "../ColorDiv/ColorDiv";
import ColorDiv, { ColorDivProps } from "../ColorDiv/ColorDiv";
export interface PageSectionProps {
center?: boolean;
+1 -1
View File
@@ -2,7 +2,7 @@ import * as React from "react";
import { Link } from "react-router-dom";
import "./SponsorReel.scss";
import TextAnchor from "../TextAnchor";
import { ColorEnum } from "../..";
import { ColorEnum } from "../ColorDiv/ColorDiv";
export interface SponsorReelProps { }
export interface SponsorReelState { }
+2 -1
View File
@@ -1,7 +1,8 @@
import * as React from "react";
import "./TextAnchor.scss";
import { Link } from "react-router-dom";
import { ColorEnum, getColor, getHoverColor } from "../..";
import { ColorEnum, getColor, getHoverColor } from "../ColorDiv/ColorDiv";
export enum TextSize {
Small,
-39
View File
@@ -5,45 +5,6 @@ import { AppContainer } from "react-hot-loader";
import Routes from "./routes";
import "./index.scss";
export enum ColorEnum {
DarkBlue,
LightBlue,
White,
Black,
Grey1,
Grey2,
Orange1,
Orange2,
Blue,
LightTurquoise,
Green,
Sand,
Transparent,
Inherit,
}
const colors = new Map<ColorEnum, string>([
[ColorEnum.DarkBlue, "dark-blue"],
[ColorEnum.LightBlue, "light-blue"],
[ColorEnum.White, "white"],
[ColorEnum.Black, "black"],
[ColorEnum.Grey1, "grey1"],
[ColorEnum.Grey2, "grey2"],
[ColorEnum.Orange1, "orange1"],
[ColorEnum.Orange2, "orange2"],
[ColorEnum.Blue, "blue"],
[ColorEnum.LightTurquoise, "light-turquoise"],
[ColorEnum.Green, "green"],
[ColorEnum.Sand, "sand"],
[ColorEnum.Transparent, "transparent"],
[ColorEnum.Inherit, "inherit"]
]);
export const getColor = (color: ColorEnum): string => `color-div__${colors.get(color)}`;
export const getBgColor = (color: ColorEnum): string => `color-div__background_${colors.get(color)}`;
export const getHoverColor = (color: ColorEnum): string => `color-div__${colors.get(color)}Hoverable`;
export const getBgHoverColor = (color: ColorEnum): string => `color-div__background_${colors.get(color)}Hoverable`;
console.log("Using API URL: ", process.env.API_URL);
const rootEl = document.getElementById("root");
+1 -2
View File
@@ -1,8 +1,7 @@
import * as React from "react";
import Helmet from "react-helmet";
import "./ContactsPage.scss";
import { ColorEnum } from "../..";
import { ColorEnum } from "../../components/ColorDiv/ColorDiv";
import { StaticContext } from "../../server/StaticContext";
import PageLink from "../../components/PageLink/PageLink";
import Card from "../../components/Card";
+2 -2
View File
@@ -9,7 +9,7 @@ import { StaticContext } from "../../server/StaticContext";
// @ts-ignore
import * as BeerImage from "../../assets/img/beer.jpeg";
import PageSection from "../../components/PageSection";
import { ColorEnum } from "../../index";
import { ColorEnum } from "../../components/ColorDiv/ColorDiv";
import PageLink from "../../components/PageLink/PageLink";
import HeroMainSection from "../../components/HeroMainSection";
@@ -18,7 +18,7 @@ import Button, { ButtonType } from "../../components/Button";
import Ribbon from "../../components/Ribbon";
import SponsorReel from "../../components/SponsorReel";
import HeroAsideItem from "../../components/HeroAsideItem";
import TextAnchor from "../../components/TextAnchor/index";
import TextAnchor from "../../components/TextAnchor";
import { TextSize } from "../../components/TextAnchor/TextAnchor";
interface FrontPageProps {
+2 -2
View File
@@ -10,9 +10,9 @@ import HeroAsideSection from "../../components/HeroAsideSection";
import HeroAsideItem from "../../components/HeroAsideItem";
import Ribbon from "../../components/Ribbon";
import InfoBox from "../../components/InfoBox";
import { ColorEnum } from "../../index";
import { ColorEnum } from "../../components/ColorDiv/ColorDiv";
import Accordion from "../../components/Accordion";
import TextAnchor from "../../components/TextAnchor/index";
import TextAnchor from "../../components/TextAnchor";
import { TextSize } from "../../components/TextAnchor/TextAnchor";
export interface GuildPageProps { }
+1 -1
View File
@@ -3,7 +3,7 @@ import Helmet from "react-helmet";
import "./SignUpPage.scss";
import { getForm, SignupForm } from "../../models/SignupForm";
import PageSection from "../../components/PageSection";
import { ColorEnum } from "../../index";
import { ColorEnum } from "../../components/ColorDiv/ColorDiv";
import { Question, optionTypes } from "../../components/SignupQuestionsWidget";
export interface SignUpPageProps {
+9 -9
View File
@@ -20,11 +20,11 @@ import ContactsPage from "./pages/ContactsPage";
import AdminSignupPage from "./pages/AdminSignupPage";
import SignupCreatePage from "./pages/SignupCreatePage";
import SignUpPage from "./pages/SignUpPage";
import ActualPage from "./pages/ActualPage/index";
import FreshmenPage from "./pages/FreshmenPage/FreshmenPage";
import StudiesPage from "./pages/StudiesPage/index";
import CorporatePage from "./pages/CorporatePage/CorporatePage";
import InEnglishPage from "./pages/InEnglishPage/index";
import ActualPage from "./pages/ActualPage";
import FreshmenPage from "./pages/FreshmenPage";
import StudiesPage from "./pages/StudiesPage";
import CorporatePage from "./pages/CorporatePage";
import InEnglishPage from "./pages/InEnglishPage";
const renderPage = (Page) => (props): JSX.Element => {
return <CommonPage page={Page} {...props} />;
@@ -60,11 +60,11 @@ const adminRoutes = [
{ path: "/admin/feed/create", page: FeedCreatePage },
{ path: "/admin/feed/:id", page: FeedCreatePage },
{ path: "/admin/events", page: AdminEventPage },
{ path: "/admin/events/create", page: EventCreatePage},
{ path: "/admin/events/:id", page: EventCreatePage},
{ path: "/admin/events/create", page: EventCreatePage },
{ path: "/admin/events/:id", page: EventCreatePage },
{ path: "/admin/signups", page: AdminSignupPage },
{ path: "/admin/signups/create", page: SignupCreatePage},
{ path: "/admin/signups/:id", page: SignupCreatePage},
{ path: "/admin/signups/create", page: SignupCreatePage },
{ path: "/admin/signups/:id", page: SignupCreatePage },
{ path: "/admin/logout", page: AdminLogoutPage },
{ path: "/admin", page: AdminFrontPage },
];