Skip to content

Commit a4b2afd

Browse files
committed
first commit
0 parents  commit a4b2afd

File tree

142 files changed

+6223
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+6223
-0
lines changed

.babelrc

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"presets": [
3+
[
4+
"env",
5+
{
6+
"modules": false
7+
}
8+
],
9+
"react"
10+
],
11+
"plugins": [
12+
"react-hot-loader/babel"
13+
],
14+
"env": {
15+
"production": {
16+
"presets": [
17+
"minify"
18+
]
19+
},
20+
"test": {
21+
"presets": [
22+
"env",
23+
"react"
24+
]
25+
}
26+
}
27+
}

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
package-lock.json
3+
typings
4+
typings.json
5+
vscode
6+
dist

.vscode/tasks.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"type": "npm",
8+
"script": "start",
9+
"group": {
10+
"kind": "build",
11+
"isDefault": true
12+
}
13+
}
14+
]
15+
}

README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# README #
2+
3+
This README would normally document whatever steps are necessary to get your application up and running.
4+
5+
### What is this repository for? ###
6+
7+
* Quick summary
8+
* Version
9+
* [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo)
10+
11+
### How do I get set up? ###
12+
13+
* Summary of set up
14+
* Configuration
15+
* Dependencies
16+
* Database configuration
17+
* How to run tests
18+
* Deployment instructions
19+
20+
### Contribution guidelines ###
21+
22+
* Writing tests
23+
* Code review
24+
* Other guidelines
25+
26+
### Who do I talk to? ###
27+
28+
* Repo owner or admin
29+
* Other community or team contact

bitbucket-pipelines.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This is a sample build configuration for JavaScript.
2+
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
3+
# Only use spaces to indent your .yml configuration.
4+
# -----
5+
# You can specify a custom docker image from Docker Hub as your build environment.
6+
pipelines:
7+
default:
8+
- step:
9+
name: Build and test
10+
image: node:8
11+
caches:
12+
- node
13+
script:
14+
- npm install
15+
- npm test
16+
- npm run build
17+
artifacts:
18+
- dist/**

package.json

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"name": "bizcardz",
3+
"version": "1.0.0",
4+
"description": "A business cards sharing app",
5+
"dependencies": {
6+
"axios": "^0.17.1",
7+
"copy-dir-cli": "0.0.3",
8+
"express": "^4.16.2",
9+
"moment": "^2.22.0",
10+
"morgan": "^1.9.0",
11+
"postcss-loader": "^2.1.6",
12+
"react": "^16.2.0",
13+
"react-dom": "^16.2.0",
14+
"react-redux": "^5.0.6",
15+
"react-router": "^4.2.0",
16+
"react-router-dom": "^4.2.2",
17+
"redux": "^3.7.2",
18+
"resolve-url-loader": "^2.3.0",
19+
"styled-components": "^3.3.3",
20+
"url-loader": "^1.0.1"
21+
},
22+
"devDependencies": {
23+
"@types/axios": "^0.14.0",
24+
"@types/jquery": "^3.2.16",
25+
"@types/node": "^8.0.47",
26+
"@types/react-dom": "^16.0.2",
27+
"@types/react-redux": "^5.0.12",
28+
"@types/react-router": "^4.0.16",
29+
"@types/react-router-dom": "^4.2.0",
30+
"@types/redux": "^3.6.0",
31+
"@types/webpack-env": "^1.13.2",
32+
"awesome-typescript-loader": "^3.4.1",
33+
"babel": "^6.23.0",
34+
"babel-core": "^6.26.0",
35+
"babel-polyfill": "^6.26.0",
36+
"babel-preset-env": "^1.6.1",
37+
"babel-preset-react": "^6.24.1",
38+
"css-loader": "^0.28.7",
39+
"html-webpack-plugin": "^2.30.1",
40+
"mocha": "^4.1.0",
41+
"node-sass": "^4.7.2",
42+
"react-hot-loader": "^3.1.3",
43+
"rimraf": "^2.6.2",
44+
"sass-loader": "^6.0.6",
45+
"source-map-loader": "^0.2.3",
46+
"style-loader": "^0.19.1",
47+
"stylelint": "^8.4.0",
48+
"stylelint-webpack-plugin": "^0.9.0",
49+
"typescript": "^2.6.1",
50+
"webpack": "^3.10.0",
51+
"webpack-cli": "^3.1.0",
52+
"webpack-dev-server": "^2.9.4"
53+
},
54+
"scripts": {
55+
"build": "rimraf dist && mkdir dist && cp -R src/assets dist/ && webpack -p",
56+
"start": "webpack-dev-server --open",
57+
"test": "mocha --exit"
58+
},
59+
"author": "Benhammouda",
60+
"license": "UNLICENSED",
61+
"private": true
62+
}

server.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
var express = require('express'),
2+
morgan = require('morgan'),
3+
port = process.env.PORT || 1337,
4+
app = express()
5+
6+
app.use(morgan('combined'))
7+
app.use(express.static('dist'))
8+
9+
app.get('*', function (req, res) {
10+
res.sendFile(__dirname + '/dist/index.html')
11+
})
12+
13+
app.listen(port)

src/actions/files.ts

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const Retrieve = (data) => {
2+
return {
3+
type: 'RETRIEVE_FILES',
4+
data
5+
}
6+
}
7+
8+
const Create = (data) => {
9+
return {
10+
type: 'CREATE_FILE',
11+
data: data
12+
}
13+
}
14+
15+
const Rename = (oldName, newName) => {
16+
return {
17+
type: 'RENAME_FILE',
18+
data: {
19+
oldName,
20+
newName
21+
}
22+
}
23+
}
24+
25+
const Delete = (id) => {
26+
return {
27+
type: 'DELETE_FILE',
28+
data: id
29+
}
30+
}
31+
32+
export default {
33+
Retrieve, Create, Rename, Delete
34+
}

src/actions/links.ts

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const Retrieve = (data) => {
2+
return {
3+
type: 'RETRIEVE_LINKS',
4+
data
5+
}
6+
}
7+
8+
const Create = (data) => {
9+
return {
10+
type: 'CREATE_LINK',
11+
data: data
12+
}
13+
}
14+
15+
const Update = (data) => {
16+
return {
17+
type: 'UPDATE_LINK',
18+
data: data
19+
}
20+
}
21+
22+
const Delete = (id) => {
23+
return {
24+
type: 'DELETE_LINK',
25+
data: id
26+
}
27+
}
28+
29+
export default {
30+
Retrieve, Create, Update, Delete
31+
}

src/actions/projects.ts

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const Retrieve = (data) => {
2+
return {
3+
type: 'RETRIEVE_PROJECTS',
4+
data
5+
}
6+
}
7+
8+
const Create = (data) => {
9+
return {
10+
type: 'CREATE_PROJECT',
11+
data: data
12+
}
13+
}
14+
15+
const Update = (data) => {
16+
return {
17+
type: 'UPDATE_PROJECT',
18+
data: data
19+
}
20+
}
21+
22+
const Delete = (name) => {
23+
return {
24+
type: 'DELETE_PROJECT',
25+
data: name
26+
}
27+
}
28+
29+
export default {
30+
Retrieve, Create, Update, Delete
31+
}

src/actions/uploads.ts

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const Retrieve = (data) => {
2+
return {
3+
type: 'RETRIEVE_UPLOADS',
4+
data
5+
}
6+
}
7+
8+
const Create = (data) => {
9+
return {
10+
type: 'CREATE_UPLOAD',
11+
data: data
12+
}
13+
}
14+
15+
const Update = (data) => {
16+
return {
17+
type: 'UPDATE_UPLOAD',
18+
data: data
19+
}
20+
}
21+
22+
const Delete = (data) => {
23+
return {
24+
type: 'DELETE_UPLOAD',
25+
data: data
26+
}
27+
}
28+
29+
export default {
30+
Retrieve, Create, Update, Delete
31+
}

src/actions/user.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const Retrieve = (data) => {
2+
return {
3+
type: 'RETRIEVE_USER',
4+
data
5+
}
6+
}
7+
8+
const Update = (data) => {
9+
return {
10+
type: 'UPDATE_USER',
11+
data: data
12+
}
13+
}
14+
15+
export default {
16+
Retrieve, Update
17+
}

src/assets/fonts/circularstd-bold.ttf

84.3 KB
Binary file not shown.

src/assets/fonts/circularstd-book.ttf

80.9 KB
Binary file not shown.

src/assets/images/cover-1.jpg

413 KB
Loading

src/assets/images/cover-2.jpg

430 KB
Loading

src/assets/images/cover-3.jpg

251 KB
Loading

src/assets/images/favicon.ico

14.7 KB
Binary file not shown.

src/assets/images/logo.svg

Loading

src/components/Button/index.tsx

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import * as React from 'react'
2+
3+
import './style.scss'
4+
5+
interface IState {
6+
loading: boolean
7+
}
8+
interface IPropos {
9+
dataDismiss?: string
10+
content: string
11+
theme: string
12+
action: any
13+
size?: string
14+
disabled?: boolean
15+
}
16+
17+
export default class Button extends React.Component<IPropos, IState> {
18+
constructor(props) {
19+
super(props)
20+
21+
this.state = {
22+
loading: false
23+
}
24+
}
25+
26+
async handleClick() {
27+
try {
28+
this.setState({ loading: true })
29+
await this.props.action()
30+
} finally {
31+
this.setState({ loading: false })
32+
}
33+
}
34+
35+
render() {
36+
return <button data-dismiss={this.props.dataDismiss} className={['button', (this.state.loading ? 'm-progress' : ''), this.props.theme, this.props.size, (this.props.disabled ? 'disabled' : '')].join(' ')} onClick={this.handleClick.bind(this)} disabled={this.props.disabled}>{this.props.content}</button>
37+
}
38+
}

0 commit comments

Comments
 (0)