Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Commit

Permalink
Remove SC and refactor the code
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuri Yakovlev committed Aug 3, 2020
1 parent 76b91f3 commit d17aed6
Show file tree
Hide file tree
Showing 56 changed files with 4,698 additions and 5,065 deletions.
12 changes: 1 addition & 11 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
"presets": ["next/babel"],
"plugins": [
["styled-components", { "ssr": true }],
"inline-react-svg",
[
"import",
{
"libraryName": "antd",
"style": "css"
}
]
]
"plugins": ["inline-react-svg"]
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ package-lock.json

npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn-error.log*
.vercel
6 changes: 0 additions & 6 deletions .nowignore

This file was deleted.

27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Yuri Yakovlev
Copyright (c) 2020 Yuri Yakovlev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
13 changes: 13 additions & 0 deletions apiHooks/useAlgolia.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import useSWR from 'swr';

import fetch from '../libs/fetch';

const useAlgolia = (phrase: string, initialData: any = {}) => {
return useSWR(
`/api/speakers${phrase ? `?phrase=${phrase}` : ''}`,
fetch,
initialData,
);
};

export default useAlgolia;
9 changes: 9 additions & 0 deletions apiHooks/useTwitter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import useSWR from 'swr';

import fetch from '../libs/fetch';

const useTwitterImage = (username: string) => {
return useSWR(`/api/twitter?username=${username}`, fetch);
};

export default useTwitterImage;
40 changes: 0 additions & 40 deletions components/RefinementList.tsx

This file was deleted.

37 changes: 0 additions & 37 deletions components/SearchBox.tsx

This file was deleted.

40 changes: 0 additions & 40 deletions components/SpeakersList.tsx

This file was deleted.

76 changes: 37 additions & 39 deletions components/button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,51 +1,49 @@
import { Icon } from 'antd';
import React from 'react';
import styled from 'styled-components';
import { FC } from 'react';

interface Props {
href: string;
icon: string;
}

const ButtonWrapper = styled.a`
width: 40px;
padding: 0;
font-size: 18px;
border-radius: 50%;
height: 40px;
line-height: 38px;
display: inline-block;
font-weight: 400;
text-align: center;
touch-action: manipulation;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
user-select: none;
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
position: relative;
box-shadow: 0 2px 0 rgba(0, 0, 0, 0.015);
color: rgba(0, 0, 0, 0.65);
background-color: #fff;
border-color: #d9d9d9;
// const ButtonWrapper = styled.a`
// width: 40px;
// padding: 0;
// font-size: 18px;
// border-radius: 50%;
// height: 40px;
// line-height: 38px;
// display: inline-block;
// font-weight: 400;
// text-align: center;
// touch-action: manipulation;
// cursor: pointer;
// background-image: none;
// border: 1px solid transparent;
// white-space: nowrap;
// user-select: none;
// transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
// position: relative;
// box-shadow: 0 2px 0 rgba(0, 0, 0, 0.015);
// color: rgba(0, 0, 0, 0.65);
// background-color: #fff;
// border-color: #d9d9d9;

&:hover,
&:focus {
color: #40a9ff;
background-color: #fff;
border-color: #40a9ff;
}
// &:hover,
// &:focus {
// color: #40a9ff;
// background-color: #fff;
// border-color: #40a9ff;
// }

&:last-child {
margin-right: 0;
}
`;
// &:last-child {
// margin-right: 0;
// }
// `;

const Button = ({ href, icon }: Props) => (
<ButtonWrapper href={href} target="_blank" rel="noopener noreferrer">
<Icon type={icon} />
</ButtonWrapper>
const Button: FC<Props> = ({ href, icon }) => (
<a href={href} target="_blank" rel="noopener noreferrer">
{/* <Icon type={icon} /> */}
</a>
);

export default Button;
3 changes: 3 additions & 0 deletions components/button/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Button from './Button';

export default Button;
Loading

0 comments on commit d17aed6

Please sign in to comment.