diff --git a/package.json b/package.json index 8232ce7..75617cf 100644 --- a/package.json +++ b/package.json @@ -101,12 +101,9 @@ "@types/react-router-dom": "^5.1.5", "@types/react-toastify": "^4.1.0", "@types/reactstrap": "^8.5.0", - "@types/rickshaw": "^0.0.29", "@types/uuid": "^8.0.1", "ace-builds": "^1.4.12", - "animate.css": "^4.1.0", "arweave": "^1.9.1", - "awesome-bootstrap-checkbox": "^1.0.1", "bootstrap": "^4.5.0", "browserfs": "1.4.3", "classnames": "^2.2.6", @@ -124,7 +121,6 @@ "lodash": "4.17.19", "normalize.css": "8.0.0", "pify": "4.0.0", - "polished": "2.2.0", "rc-hammerjs": "^0.6.10", "react": "^16.13.1", "react-ace": "^9.1.2", @@ -154,7 +150,6 @@ "remark-parse": "5.0.0", "remark-react": "4.0.3", "remark-rehype": "3.0.1", - "rickshaw": "^1.7.1", "styled-components": "3.4.9", "textlint-rule-no-todo": "2.0.1", "textlint-rule-prh": "5.2.0", diff --git a/src/lib/babel.js b/src/lib/babel.js deleted file mode 100644 index c07bcf0..0000000 --- a/src/lib/babel.js +++ /dev/null @@ -1,17 +0,0 @@ -const prettier = require("prettier/standalone") -const babel = require("@babel/standalone") -const babelConfig = { - presets: ["react", "stage-3"], - sourceMaps: false -} - -const plugins = [require("prettier/parser-babylon")] - -export function compileWithBabel(source) { - const compiled = babel.transform(source, babelConfig) - const formatted = prettier.format(compiled.code, { - parser: "babylon", - plugins - }) - return formatted -} diff --git a/src/ui/components/App.tsx b/src/ui/components/App.tsx index 50c2f73..13104d0 100644 --- a/src/ui/components/App.tsx +++ b/src/ui/components/App.tsx @@ -5,7 +5,6 @@ import { configureStore } from "../store/configureStore" import { LandingNew } from "./argit/LandingNew" import { LoginModal } from "./argit/loginModal" import { GlobalErrorBoundary } from "./utils/GlobalErrorBoundary" -import { GlobalKeyHandler } from "./utils/GlobalKeyHandler" import { HashRouter, Switch, Route, Redirect } from "react-router-dom" import { Layout } from "./argit/Layout/Layout" export class App extends React.Component<{}> { @@ -15,24 +14,22 @@ export class App extends React.Component<{}> { - - - - } - /> + + + } + /> - } - /> - - - - - + } + /> + + + + diff --git a/src/ui/components/argit/BreadcrumbHistory/BreadcrumbHistory.tsx b/src/ui/components/argit/BreadcrumbHistory/BreadcrumbHistory.tsx deleted file mode 100644 index 5a6fd08..0000000 --- a/src/ui/components/argit/BreadcrumbHistory/BreadcrumbHistory.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import * as React from "react" -import { Breadcrumb, BreadcrumbItem } from "reactstrap" -import { v4 as uuid } from "uuid" - -export interface BreadcrumbHistoryProps { - url: string -} - -export interface BreadcrumbHistoryState {} - -class BreadcrumbHistory extends React.Component< - BreadcrumbHistoryProps, - BreadcrumbHistoryState -> { - renderBreadCrumbs = () => { - let route = this.props.url - .split("/") - .slice(1) - .map(route => - route - .split("-") - .map(word => word[0].toUpperCase() + word.slice(1)) - .join(" ") - ) - const length = route.length - return route.map( - (item, index) => - length === index + 1 ? ( - - {item} - - ) : ( - {item} - ) - ) - } - - render() { - return ( - <> - {this.props.url !== "/app/chat" ? ( -
- - YOU ARE HERE - {this.renderBreadCrumbs()} - -
- ) : null} - - ) - } -} - -export default BreadcrumbHistory diff --git a/src/ui/components/argit/BreadcrumbHistory/package.json b/src/ui/components/argit/BreadcrumbHistory/package.json deleted file mode 100644 index 3d0cf7d..0000000 --- a/src/ui/components/argit/BreadcrumbHistory/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "BreadcrumbHistory", - "version": "0.0.0", - "private": true, - "main": "./BreadcrumbHistory.tsx" -} diff --git a/src/ui/components/argit/Dashboard/Dashboard.module.scss b/src/ui/components/argit/Dashboard/Dashboard.module.scss deleted file mode 100644 index 1518605..0000000 --- a/src/ui/components/argit/Dashboard/Dashboard.module.scss +++ /dev/null @@ -1,38 +0,0 @@ -@import "../styles/app"; - -.root { - :global { - .post-comments footer { - margin: 0 (-$widget-padding-horizontal) (-$widget-padding-vertical); - padding: $widget-padding-vertical $widget-padding-horizontal; - } - - .stat-item .name { - margin-top: 10px; - } - - .list-group-item:hover { - background-color: $bg-addition; - } - - .detail { - .x_label { - background: $widget-bg-color !important; - } - } - } -} - -.table { - :global(.table.table-sm) { - td { - font-size: 1rem; - vertical-align: middle; - } - } -} - -.searchBtn { - border-top-left-radius: 0px; - border-bottom-left-radius: 0px; -} diff --git a/src/ui/components/argit/Dashboard/Dashboard.module.scss.d.ts b/src/ui/components/argit/Dashboard/Dashboard.module.scss.d.ts deleted file mode 100644 index dc475c0..0000000 --- a/src/ui/components/argit/Dashboard/Dashboard.module.scss.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface IDashboardModuleScss { - root: string - table: string - searchBtn: string -} - -export const locals: IDashboardModuleScss diff --git a/src/ui/components/argit/Dashboard/Dashboard.tsx b/src/ui/components/argit/Dashboard/Dashboard.tsx deleted file mode 100644 index b89dbb5..0000000 --- a/src/ui/components/argit/Dashboard/Dashboard.tsx +++ /dev/null @@ -1,220 +0,0 @@ -import { format } from "date-fns" -import * as React from "react" -import { Link } from "react-router-dom" -import { CardBody, CardTitle, Col, Row } from "reactstrap" -import { lifecycle } from "recompose" -import { arweave } from "../../../../index" -import { getAllActivities, txQuery } from "../../../../utils" -import { connector } from "../../../actionCreators/index" -import { openCreateRepoModal } from "../../../reducers/app" -import { - Activity, - loadActivities, - loadAddress, - loadNotifications, - Notification, - Repository, - setIsAuthenticated, - updateRepositories -} from "../../../reducers/argit" -import Widget from "../Widget/Widget" -import s from "./Dashboard.module.scss" - -type ConnectedProps = { - isAuthenticated: boolean - repositories: Repository[] - setIsAuthenticated: typeof setIsAuthenticated - loadAddress: typeof loadAddress - updateRepositories: typeof updateRepositories - openCreateRepoModal: typeof openCreateRepoModal - loadNotifications: typeof loadNotifications - notifications: Notification[] - loadActivities: typeof loadActivities - activities: Activity[] -} - -export const Dashboard = connector( - state => ({ - repositories: state.argit.repositories, - address: state.argit.address, - isAuthenticated: state.argit.isAuthenticated, - notifications: state.argit.notifications, - activities: state.argit.activities - }), - actions => ({ - loadAddress: actions.argit.loadAddress, - updateRepositories: actions.argit.updateRepositories, - openCreateRepoModal: actions.app.openCreateRepoModal, - loadNotifications: actions.argit.loadNotifications, - loadActivities: actions.argit.loadActivities - }), - lifecycle({ - async componentDidMount() { - // UI Boot - // await delay(150) - - const { isAuthenticated, repositories, ...actions } = this.props - - if (isAuthenticated) { - const address = await arweave.wallets.jwkToAddress( - JSON.parse(String(sessionStorage.getItem("keyfile"))) - ) - actions.loadAddress({ address }) - - const activities = await getAllActivities(arweave, address) - actions.loadActivities({ activities }) - - const txids = await arweave.arql(txQuery(address, "create-repo")) - let notifications: Notification[] = [] - let completed_txids: String[] = [] - const repositories = await Promise.all( - txids.map(async txid => { - let repository = {} as Repository - try { - const data: any = await arweave.transactions.getData(txid, { - decode: true, - string: true - }) - - const decoded: any = JSON.parse(data) - repository = { - name: decoded.name, - description: decoded.description - } - completed_txids.push(txid) - } catch (error) { - repository = { - name: txid, - description: "Pending confirmation" - } - notifications.push({ - type: "pending", - action: "Create Repo", - txid: txid - }) - } - - if (!repository) { - repository = { - name: txid, - description: "null" - } - } - - return repository - }) - ) - const newNotifications = notifications.map(notif => { - if (notif.type == "pending" && completed_txids.includes(notif.txid)) { - return { - type: "confirmed", - action: "Create Repo", - txid: notif.txid - } - } else { - return { - type: "pending", - action: "Create Repo", - txid: notif.txid - } - } - }) - actions.loadNotifications({ notifications: newNotifications }) - actions.updateRepositories({ repositories }) - } - } - }) -)(function Dashboard(props) { - return ( -
-

- Activity Feed -

- - - - {props.activities.map(activity => ( -
-
- - - {/* - ... - */} - - - {activity.type === "create-repo" - ? " New Repo Created" - : "Repo Updated"} - - -
- - {activity.repoName || activity.key} - -
- {format( - parseInt(activity.unixTime) * 1000, - "MM/DD HH:mm" - )} -
-
- {activity.type === "create-repo" - ? activity.value - : `Updated ref ${activity.key} => ${activity.value}`} -
-
-
-
-
- ))} - - - - - - {" "} - Active -  Repositories - - } - > -
- {props.repositories.map(repository => ( -
- - -     - - {repository.name} - - -
- ))} -
-
- -
-
- ) -}) diff --git a/src/ui/components/argit/Dashboard/package.json b/src/ui/components/argit/Dashboard/package.json deleted file mode 100644 index 6059833..0000000 --- a/src/ui/components/argit/Dashboard/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Dashboard", - "version": "0.0.0", - "private": true, - "main": "./Dashboard.tsx" -} diff --git a/src/ui/components/argit/Header/Header.module.scss.d.ts b/src/ui/components/argit/Header/Header.module.scss.d.ts deleted file mode 100644 index e0e4514..0000000 --- a/src/ui/components/argit/Header/Header.module.scss.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -export interface IHeaderModuleScss { - 'root': string; - 'logo': string; - 'logoHidden': string; - 'searchCollapse': string; - 'navbarForm': string; - 'inputAddon': string; - 'navbarFormFocused': string; - 'divider': string; - 'navItem': string; - 'image': string; - 'imageAccount': string; - 'dropdownMenu': string; - 'messages': string; - 'details': string; - 'text': string; - 'support': string; - 'account': string; - 'settings': string; - 'count': string; - 'notificationsMenu': string; - 'accountCheck': string; - 'notificationsWrapper': string; - 'avatar': string; - 'badge': string; -} - -export const locals: IHeaderModuleScss; diff --git a/src/ui/components/argit/Header/Header.tsx b/src/ui/components/argit/Header/Header.tsx index e020a0c..4b58ec7 100644 --- a/src/ui/components/argit/Header/Header.tsx +++ b/src/ui/components/argit/Header/Header.tsx @@ -1,4 +1,3 @@ -import "animate.css" import * as React from "react" import { Badge, diff --git a/src/ui/components/argit/Header/package.json b/src/ui/components/argit/Header/package.json deleted file mode 100644 index 6115700..0000000 --- a/src/ui/components/argit/Header/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Header", - "version": "0.0.0", - "private": true, - "main": "./Header.tsx" -} diff --git a/src/ui/components/argit/Landing.css b/src/ui/components/argit/Landing.css deleted file mode 100644 index 72c573f..0000000 --- a/src/ui/components/argit/Landing.css +++ /dev/null @@ -1,125 +0,0 @@ - /* ! - * Start Bootstrap - Landing Page v5.0.8 (https://startbootstrap.com/themes/landing-page) - * Copyright 2013-2020 Start Bootstrap - * Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-landing-page/blob/master/LICENSE) - -body { - font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif; -} - -h1, -h2, -h3, -h4, -h5, -h6 { - font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif; - font-weight: 700; -} - -header.masthead { - position: relative; - background-color: #343a40; - background: url(../../../../assets/bg-masthead.jpg) no-repeat center center; - background-size: cover; - padding-top: 8rem; - padding-bottom: 8rem; -} - -header.masthead .overlay { - position: absolute; - background-color: #212529; - height: 100%; - width: 100%; - top: 0; - left: 0; - opacity: 0.3; -} - -header.masthead h1 { - font-size: 2rem; -} - -@media (min-width: 768px) { - header.masthead { - padding-top: 12rem; - padding-bottom: 12rem; - } - header.masthead h1 { - font-size: 3rem; - } -} - -.showcase .showcase-text { - padding: 3rem; -} - -.showcase .showcase-img { - min-height: 30rem; - background-size: cover; -} - -@media (min-width: 768px) { - .showcase .showcase-text { - padding: 7rem; - } -} - -.features-icons { - padding-top: 7rem; - padding-bottom: 7rem; -} - -.features-icons .features-icons-item { - max-width: 20rem; -} - -.features-icons .features-icons-item .features-icons-icon { - height: 7rem; -} - -.features-icons .features-icons-item .features-icons-icon i { - font-size: 4.5rem; -} - -.features-icons .features-icons-item:hover .features-icons-icon i { - font-size: 5rem; -} - -.testimonials { - padding-top: 7rem; - padding-bottom: 7rem; -} - -.testimonials .testimonial-item { - max-width: 18rem; -} - -.testimonials .testimonial-item img { - max-width: 12rem; - box-shadow: 0px 5px 5px 0px #adb5bd; -} - -.call-to-action { - position: relative; - background-color: #343a40; - background: url(../../../../assets/bg-masthead.jpg) no-repeat center center; - background-size: cover; - padding-top: 7rem; - padding-bottom: 7rem; -} - -.call-to-action .overlay { - position: absolute; - background-color: #212529; - height: 100%; - width: 100%; - top: 0; - left: 0; - opacity: 0.3; -} - -footer.footer { - padding-top: 4rem; - padding-bottom: 4rem; -} diff --git a/src/ui/components/argit/Landing.tsx b/src/ui/components/argit/Landing.tsx deleted file mode 100644 index 4f360b0..0000000 --- a/src/ui/components/argit/Landing.tsx +++ /dev/null @@ -1,215 +0,0 @@ -import * as React from "react" -import { HashRouter, Redirect, Route, Switch } from "react-router-dom" -import { connector } from "../../actionCreators/index" -import hero from "../argit/images/hero.svg" -import hero2 from "../argit/images/hero2.svg" -import heromain from "../argit/images/heromain.svg" -import { Layout } from "./Layout/Layout" -import "./styles/theme.scss" - -export const Landing = connector( - state => ({ - isAuthenticated: state.argit.isAuthenticated - }), - actions => ({ - openLoginModal: actions.argit.openLoginModal - }) -)(function LandingImpl(props) { - if (props.isAuthenticated) - return ( - - - } - /> - - - ) - - return ( - - -
-
-
-

- d - git -

-

- Permanent versioning for your  Code -

- - -
-
- -
-
-
-
- - - - - - - - - - - - -
-
-
-

- What makes us different? -

-
-
-
- -
-
-

- Permanent home for your code -

-

- All your code is stored on the blockchain forever so anything - stored with dgit will never be lost, even when you accidently - force push :D -
-
-

-
-
- -
-
- -
-
- -
-
-
-

- Always available for you -

-

- All your code is mirrored across the distributed network of - blockchain nodes, so you don't need to rely on a centralized - server. -
-
-

-
-
-
-
-
- - - - - - - - - - - - - - - - - -
-

- Enough talk, lets dgit -

-
-
-
- - -
- -
-
-
-
-

- d - git -

-
-

- Made with -   by TechTrap LLP -

-
-
-
-
-
-
- ) -}) - -export default Landing diff --git a/src/ui/components/argit/LandingNew.tsx b/src/ui/components/argit/LandingNew.tsx index f6c9ed4..96c43fe 100644 --- a/src/ui/components/argit/LandingNew.tsx +++ b/src/ui/components/argit/LandingNew.tsx @@ -88,7 +88,7 @@ export const LandingNew = connector(
  • - + Gitopia
  • @@ -131,11 +131,11 @@ export const LandingNew = connector(

    Decentralized -

    +  Collaboration  Communities  Source Code -
    +

    {/*

    Permanent versioning for your Code diff --git a/src/ui/components/argit/Layout/Layout.module.scss.d.ts b/src/ui/components/argit/Layout/Layout.module.scss.d.ts deleted file mode 100644 index 0fbf044..0000000 --- a/src/ui/components/argit/Layout/Layout.module.scss.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface ILayoutModuleScss { - 'root': string; - 'wrap': string; - 'content': string; - 'contentFooter': string; -} - -export const locals: ILayoutModuleScss; diff --git a/src/ui/components/argit/Layout/Layout.tsx b/src/ui/components/argit/Layout/Layout.tsx index 9a185d5..d261214 100644 --- a/src/ui/components/argit/Layout/Layout.tsx +++ b/src/ui/components/argit/Layout/Layout.tsx @@ -1,15 +1,10 @@ import Hammer from "rc-hammerjs" import * as React from "react" -import { Redirect, Route, Switch } from "react-router-dom" import { CSSTransition, TransitionGroup } from "react-transition-group" import { connector } from "../../../actionCreators/index" import { StackRouter } from "../../utils/StackRouter" -import BreadcrumbHistory from "../BreadcrumbHistory/BreadcrumbHistory" import { Commits } from "../commits" -import { Dashboard } from "../Dashboard/Dashboard" import Header from "../Header/Header" -import PullRequest from "../PullRequest" -import { Sidebar } from "../Sidebar/Sidebar" import s from "./Layout.module.scss" import dlogo from "../../argit/images/dlogo.svg" import { Sponsor } from "../Sponsor" diff --git a/src/ui/components/argit/Layout/package.json b/src/ui/components/argit/Layout/package.json deleted file mode 100644 index def5a1b..0000000 --- a/src/ui/components/argit/Layout/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Layout", - "version": "0.0.0", - "private": true, - "main": "./Layout.tsx" -} diff --git a/src/ui/components/argit/Loader/Loader.module.scss b/src/ui/components/argit/Loader/Loader.module.scss deleted file mode 100644 index 6bc4a20..0000000 --- a/src/ui/components/argit/Loader/Loader.module.scss +++ /dev/null @@ -1,14 +0,0 @@ -@import "../styles/app"; - -.root { - width: 100%; - height: 100%; - display: flex; - align-items: center; - justify-content: center; - - i { - font-size: 21px; - margin: 0 $spacer; - } -} diff --git a/src/ui/components/argit/Loader/Loader.module.scss.d.ts b/src/ui/components/argit/Loader/Loader.module.scss.d.ts deleted file mode 100644 index 7ab190d..0000000 --- a/src/ui/components/argit/Loader/Loader.module.scss.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface ILoaderModuleScss { - 'root': string; -} - -export const locals: ILoaderModuleScss; diff --git a/src/ui/components/argit/Loader/Loader.tsx b/src/ui/components/argit/Loader/Loader.tsx deleted file mode 100644 index f03d050..0000000 --- a/src/ui/components/argit/Loader/Loader.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import cx from "classnames" -import * as React from "react" -import s from "./Loader.module.scss" - -export interface LoaderProps { - size: number - className: string -} - -class Loader extends React.Component { - render() { - return ( -

    - -
    - ) - } -} - -export default Loader diff --git a/src/ui/components/argit/Loader/package.json b/src/ui/components/argit/Loader/package.json deleted file mode 100644 index 3c62f8c..0000000 --- a/src/ui/components/argit/Loader/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Loader", - "version": "0.0.0", - "private": true, - "main": "./Loader.tsx" -} diff --git a/src/ui/components/argit/Notifications/notifications-demo/NewNotifications.tsx b/src/ui/components/argit/Notifications/notifications-demo/NewNotifications.tsx deleted file mode 100644 index 109858b..0000000 --- a/src/ui/components/argit/Notifications/notifications-demo/NewNotifications.tsx +++ /dev/null @@ -1,123 +0,0 @@ -import React from "react" -import { Button, ListGroup, ListGroupItem } from "reactstrap" -import a3 from "../../images/people/a3.jpg" -import a5 from "../../images/people/a5.jpg" -import a6 from "../../images/people/a6.jpg" -import s from "./ListGroup.module.scss" - -class NewNotificationsDemo extends React.Component { - render() { - return ( - - - - - -

    - 2 issues require your approval. - {/* eslint-disable */} -   - The Search Project completed on time! - {/* eslint-enable */} - -

    -
    - - - ... - -

    - - has just endorsed you with 50 points! - -

    -
    - - - ... - -

    - 1 new user just signed up! Check out - {/* eslint-disable */} -   - Monica Smith - 's account. - {/* eslint-enable */} - -

    -
    - - - - -

    - 2.1.0-pre-alpha just released. - -

    -
    - - - - -

    - Server load limited. - -

    -
    - - - ... - -

    - {/* eslint-disable */} - User Jeff registered - {/* eslint-enable */} -    - - - -

    -
    - - - - -

    - {/* eslint-disable */} - Instructions for changing your Envato Account password. Please check - your account security page.{/* eslint-enable */} - -

    -
    - - - - - - -

    - New 76 facebook likes received. - -

    -
    - - - - - - -

    - Dark matter detected. - -

    -
    -
    - ) - } -} - -export default NewNotificationsDemo diff --git a/src/ui/components/argit/Notifications/package.json b/src/ui/components/argit/Notifications/package.json deleted file mode 100644 index 12cc945..0000000 --- a/src/ui/components/argit/Notifications/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Notifications", - "version": "0.0.0", - "private": true, - "main": "./Notifications.tsx" -} diff --git a/src/ui/components/argit/Pagination.tsx b/src/ui/components/argit/Pagination.tsx index bc2a8b9..534a8fd 100644 --- a/src/ui/components/argit/Pagination.tsx +++ b/src/ui/components/argit/Pagination.tsx @@ -5,7 +5,6 @@ import { } from "reactstrap" import * as React from "react" import { Link } from "react-router-dom" -import { setTxLoading } from "../../reducers/argit" export class Pagination extends React.Component { constructor(props) { @@ -125,47 +124,45 @@ export class Pagination extends React.Component {

    The user has no repositories.

    ))} {!this.props.txLoading && - this.state.currentObjs.map(obj => { + this.state.currentObjs.map((obj, index) => { return ( - <> -
      -
    • - {" "} -
      - {this.props.mainItems.repos[obj].name && ( - { - this.props.setTxLoading({ loading: true }) - this.props.updatePage({ page: "repo" }) - }} - > - - - - {this.props.mainItems.repos[obj].name} - - )} -
      +
        +
      • + {" "} +
        {this.props.mainItems.repos[obj].name && ( - + { + this.props.setTxLoading({ loading: true }) + this.props.updatePage({ page: "repo" }) + }} + > + + + + {this.props.mainItems.repos[obj].name} + )} -
      • -
      - + + {this.props.mainItems.repos[obj].name && ( + + )} +
    • +
    ) })} {!this.props.txLoading && diff --git a/src/ui/components/argit/PullRequest.tsx b/src/ui/components/argit/PullRequest.tsx deleted file mode 100644 index e7fd676..0000000 --- a/src/ui/components/argit/PullRequest.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import * as React from "react" -import pr from "../argit/images/pr.svg" - -export interface PullRequestProps {} - -const PullRequest: React.SFC = () => { - return ( - <> - -

    Coming Soon...

    - - ) -} - -export default PullRequest diff --git a/src/ui/components/argit/Repositories.tsx b/src/ui/components/argit/Repositories.tsx deleted file mode 100644 index 79fd844..0000000 --- a/src/ui/components/argit/Repositories.tsx +++ /dev/null @@ -1,396 +0,0 @@ -import * as React from "react" -import { Link } from "react-router-dom" -import { Table } from "reactstrap" -import { lifecycle } from "recompose" -import styled, { consolidateStreamedStyles } from "styled-components" -import { arweave } from "../../../index" -import { connector } from "../../actionCreators/index" -import { openCreateRepoModal } from "../../reducers/app" -import { filter } from "fuzzaldrin" -import { format } from "date-fns" -import { Container, Row, Col } from "reactstrap" - -import { - loadAddress, - loadNotifications, - Notification, - Repository, - setIsAuthenticated, - updateRepositories, - openSponsorModal, - loadActivities -} from "../../reducers/argit" -import { getAllActivities, txQuery } from "./../../../utils" - -import { - Loading, - Owner, - IssueList, - FilterList, - PageNav, - OwnerProfile, - RepoInfo, - IssueLabel -} from "../argit/Repository/RepositoryStyles" -import NewContainer, { - Icon, - List, - SubmitButton, - Form -} from "../argit/Repository/Container" -import dlogo from "../argit/images/dlogo.svg" - -import { - setTxLoading, - updateMainItems, - Activity, - updateFilterIndex -} from "../../reducers/argit" -import { Sponsor } from "./Sponsor" - -type ConnectedProps = { - isAuthenticated: boolean - repositories: Repository[] - setIsAuthenticated: typeof setIsAuthenticated - loadAddress: typeof loadAddress - updateRepositories: typeof updateRepositories - openCreateRepoModal: typeof openCreateRepoModal - loadNotifications: typeof loadNotifications - notifications: typeof Notification[] - setTxLoading: typeof setTxLoading - txLoading: boolean - mainItems: { repos: {}; activities: {} } - updateMainItems: typeof updateMainItems - openSponsorModal: typeof openSponsorModal - filterIndex: Number - updateFilterIndex: typeof updateFilterIndex - loadActivities: typeof loadActivities - activities: Activity[] -} - -export const Repositories = connector( - state => ({ - repositories: state.argit.repositories, - address: state.argit.address, - isAuthenticated: state.argit.isAuthenticated, - notifications: state.argit.notifications, - txLoading: state.argit.txLoading, - mainItems: state.argit.mainItems, - filterIndex: state.argit.filterIndex, - activities: state.argit.activities - }), - actions => ({ - loadAddress: actions.argit.loadAddress, - updateRepositories: actions.argit.updateRepositories, - openCreateRepoModal: actions.app.openCreateRepoModal, - loadNotifications: actions.argit.loadNotifications, - updateMainItems: actions.argit.updateMainItems, - openSponsorModal: actions.argit.openSponsorModal, - updateFilterIndex: actions.argit.updateFilterIndex, - loadActivities: actions.argit.loadActivities, - setTxLoading: actions.argit.setTxLoading - }), - - lifecycle({ - async componentDidMount() { - this.props - // UI Boot - // await delay(150) - .setTxLoading({ loading: true }) - - const { isAuthenticated, repositories, ...actions } = this.props - let address = this.props.match.params.wallet_address - - if (isAuthenticated) { - address = await arweave.wallets.jwkToAddress( - JSON.parse(String(sessionStorage.getItem("keyfile"))) - ) - } - - actions.loadAddress({ address }) - const activities = await getAllActivities(arweave, address) - console.log(activities) - - actions.loadActivities({ activities: activities }) - const txids = await arweave.arql(txQuery(address, "create-repo")) - let notifications: Notification[] = [] - let completed_txids: String[] = [] - const repos = await Promise.all( - txids.map(async txid => { - let repository = {} as Repository - try { - const data: any = await arweave.transactions.getData(txid, { - decode: true, - string: true - }) - // if (typeof data === "object") { - // console.log(new TextDecoder("utf-8").decode(data)) - // } - if (typeof data === "string" && data !== "") { - const decoded: any = JSON.parse(data) - repository = { - name: decoded.name, - description: decoded.description, - txid: txid, - status: "confirmed" - } - completed_txids.push(txid) - } else if (data === "") { - repository = { - name: "Arweave server error", - description: "Arweave server error", - txid: txid, - status: "confirmed" - } - completed_txids.push(txid) - } else { - throw new Error("Pendng Transaction") - } - } catch (error) { - repository = { - name: "Pending", - txid: txid, - status: "pending", - description: "Pending" - } - notifications.push({ - type: "pending", - action: "Create Repo", - txid: txid - }) - } - - if (!repository) { - repository = { - txid: txid, - description: "Pending", - status: "pending", - name: "Pending" - } - } - - return repository - }) - ) - const newNotifications = this.props.notifications - .filter( - notif => - notif.type == "pending" && completed_txids.includes(notif.txid) - ) - .map(notif => ({ - type: "confirmed", - action: "Create Repo", - txid: notif.txid - })) - let finalNotifications = [...notifications, ...newNotifications] - actions.loadNotifications({ notifications: finalNotifications }) - actions.updateRepositories({ repositories: repos }) - let names: string[] = [] - let objects: {} = {} - this.props.repositories.forEach(item => { - let itemname = item.name - names.push(item.name) - objects[itemname] = item - }) - console.log(objects) - actions.updateMainItems({ - mainItem: { - repos: objects, - activities: this.props.mainItems.activities - } - }) - this.props.setTxLoading({ loading: false }) - } - }) -)(function RepositoriesImpl(props) { - function handleChange(e: string) { - let names: string[] = [] - let objects: {} = {} - props.repositories.forEach(item => { - let itemname = item.name - names.push(item.name) - objects[itemname] = item - }) - const results = filter(names, e.target.value) - props.updateMainItems({ - mainItems: { repos: objects, activities: {} } - }) - } - let filters = [ - { state: "repos", label: "Repositories", active: true }, - { state: "activity", label: "Activity", active: false }, - { state: "overview", label: "Overview", active: false } - ] - - function handleFilter(index: number) { - console.log(index) - props.updateFilterIndex({ filterIndex: index }) - let names: [] = [] - let objects: {} = {} - - if (index == 0) { - props.repositories.forEach(item => { - let itemname = item.name - // names.push(item.name) - objects[itemname] = item - }) - console.log(names) - props.updateMainItems({ - mainItems: { repos: objects, activities: {} } - }) - } else if (index == 1) { - props.activities.forEach(item => { - let itemname = item.txid - // names.push(item.txid) - objects[itemname] = item - }) - props.updateMainItems({ - mainItems: { repos: {}, activities: objects } - }) - } else if (index == 2) { - // props.updateMainItems({ - // mainItems: { - // repos: props.mainItems.repos, - // activities: props.mainItems.activities - // } - // }) - } - props.updateFilterIndex({ filterIndex: index }) - } - - const Button = styled.i` - cursor: pointer; - ` - const { activities, repos } = props.mainItems - if (props.txLoading) - return ( - <> - - - - - - - - ) - - return ( - <> - - - {filters.map((filter, index) => ( - - ))} - - {props.filterIndex === 0 && ( -
    - - {props.isAuthenticated && ( - { - props.openCreateRepoModal({}) - }} - loading={props.txLoading ? 1 : 0} - > - - - )} -
    - )} - - - {props.filterIndex == 0 && - props.repositories && - Object.keys(repos).map(name => ( -
  • -
    - {repos[name] && - !repos[name].type && ( - - {name} - {name} - - )} -
    - {repos[name] && - repos[name].status === "confirmed" && ( - - )} - {repos[name] && - repos[name].status === "pending" && ( - - )} -
  • - ))} - {props.filterIndex == 1 && - props.activities && - Object.keys(activities).map(txid => ( -
  • -
    - - - - - - {`${txid}`.replace(/(.{15})..+/, "$1...")} - - - - {activities[txid].repoName || activities[txid].key} - - - - {format( - parseInt(activities[txid].unixTime) * 1000, - "MM/DD HH:mm" - )} - - - - - {activities[txid].type === "create-repo" - ? activities[txid].value - : `Updated ref ${activities[txid].key}`} - - - - - -
    -
  • - ))} -
    - - - - - -
    - - - ) -}) diff --git a/src/ui/components/argit/Repository/api.js b/src/ui/components/argit/Repository/api.js deleted file mode 100644 index 1595c4a..0000000 --- a/src/ui/components/argit/Repository/api.js +++ /dev/null @@ -1,7 +0,0 @@ -import axios from "axios" - -const api = axios.create({ - baseURL: "https://api.github.com" -}) - -export default api diff --git a/src/ui/components/argit/Sidebar/LinksGroup/LinksGroup.module.scss b/src/ui/components/argit/Sidebar/LinksGroup/LinksGroup.module.scss deleted file mode 100644 index 591bc70..0000000 --- a/src/ui/components/argit/Sidebar/LinksGroup/LinksGroup.module.scss +++ /dev/null @@ -1,112 +0,0 @@ -@import "../../styles/app"; - -.headerLink { - overflow-x: hidden; - - @media (min-width: map_get($grid-breakpoints, lg)) and (min-height: $screen-lg-height), - (max-width: map_get($grid-breakpoints, md) - 1px) { - font-size: $font-size-base; - } - - a { - font-size: 15px; - display: block; - color: $sidebar-color; - text-decoration: none; - cursor: pointer; - - &:hover { - text-decoration: none; - color: inherit; - } - } - - &:last-child > a { - border-bottom: 1px solid $sidebar-item-border-color; - } - - > a { - position: relative; - align-items: center; - padding: $sidebar-item-padding; - border-top: 1px solid $sidebar-item-border-color; - white-space: nowrap; - border-radius: 0.25rem; - - &:hover { - background-color: $sidebar-item-hover-bg-color; - } - } - - .icon { - margin-right: 0.5rem; - max-height: 20px; - max-width: 14px; - text-align: center; - opacity: 0.6; - } - - .badge { - float: right; - line-height: 8px; - margin-right: 5px; - padding: 7px; - } -} - -.headerLabel { - font-weight: 600; - color: theme-color("warning"); -} - -.collapsed .caret { - transform: rotate(-90deg); -} - -.caret { - position: absolute; - right: 10px; - display: flex; - align-items: center; - - @include transition(transform 0.3s ease-in-out); -} - -a.headerLinkActive { - font-weight: bold; -} - -.accordionToggle:focus { - background-color: $sidebar-item-hover-bg-color; -} - -.panel { - border: none; - box-shadow: none; - margin: 0; - border-radius: 0; - background-color: lighten($sidebar-bg-color, 5%); - - a.headerLinkActive { - font-weight: $font-weight-bold; - color: $sidebar-color; - } - - ul { - background: $sidebar-action-bg; - padding: 0.25rem 0; - - li { - list-style: none; - } - - a { - padding: $sidebar-sub-item-padding; - font-size: $font-size-mini; - - &:hover { - background-color: $sidebar-item-hover-bg-color; - } - } - } -} diff --git a/src/ui/components/argit/Sidebar/LinksGroup/LinksGroup.module.scss.d.ts b/src/ui/components/argit/Sidebar/LinksGroup/LinksGroup.module.scss.d.ts deleted file mode 100644 index b5b9357..0000000 --- a/src/ui/components/argit/Sidebar/LinksGroup/LinksGroup.module.scss.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface ILinksGroupModuleScss { - 'headerLink': string; - 'icon': string; - 'badge': string; - 'headerLabel': string; - 'collapsed': string; - 'caret': string; - 'headerLinkActive': string; - 'accordionToggle': string; - 'panel': string; -} - -export const locals: ILinksGroupModuleScss; diff --git a/src/ui/components/argit/Sidebar/LinksGroup/LinksGroup.tsx b/src/ui/components/argit/Sidebar/LinksGroup/LinksGroup.tsx deleted file mode 100644 index 7e97987..0000000 --- a/src/ui/components/argit/Sidebar/LinksGroup/LinksGroup.tsx +++ /dev/null @@ -1,194 +0,0 @@ -import classnames from "classnames" -import React, { Component } from "react" -import { NavLink, Route } from "react-router-dom" -import { Badge, Collapse } from "reactstrap" -import { changeActiveSidebarItem } from "../../../../reducers/navigation" -import s from "./LinksGroup.module.scss" - -type LinksGroupProps = { - header: string - link: string - iconName: string - isHeader: boolean - index: string - childrenLinks: any[] - className: string - badge: string - label: string - activeItem: string - deep: number - labelColor: string - exact: boolean - onActiveSidebarItemChange: typeof changeActiveSidebarItem -} - -export default class LinksGroup extends Component { - static defaultProps = { - link: "", - childrenLinks: null, - header: "", - className: "", - isHeader: false, - deep: 0, - activeItem: "", - label: "", - exact: true - } - - state = { - headerLinkWasClicked: true - } - - constructor(props: LinksGroupProps) { - super(props) - this.togglePanelCollapse = this.togglePanelCollapse.bind(this) - } - - togglePanelCollapse(link, e) { - this.props.onActiveSidebarItemChange({ activeItem: link }) - this.setState({ - headerLinkWasClicked: - !this.state.headerLinkWasClicked || - (this.props.activeItem && - !this.props.activeItem.includes(this.props.index)) - }) - e.preventDefault() - } - - render() { - const isOpen = - this.props.activeItem && - this.props.activeItem.includes(this.props.index) && - this.state.headerLinkWasClicked - - const { exact } = this.props - - if (!this.props.childrenLinks) { - if (this.props.isHeader) { - return ( -
  • - - - - - {this.props.header}{" "} - {this.props.label && ( - - {this.props.label} - - )} - {this.props.badge && ( - - 9 - - )} - {" "} -
  • - ) - } - return ( -
  • - { - // able to go to link is not available(for Demo) - if (this.props.link.includes("menu")) { - e.preventDefault() - } - }} - exact={exact} - > - {this.props.header}{" "} - {this.props.label && ( - - {this.props.label} - - )} - -
  • - ) - } - /* eslint-disable */ - return ( - { - const { match } = params - return ( -
  • - this.togglePanelCollapse(this.props.link, e)} - href="#" - > - {this.props.isHeader ? ( - - - - ) : null} - {this.props.header}{" "} - {this.props.label && ( - - {this.props.label} - - )} - - - {/* eslint-enable */} - -
      - {this.props.childrenLinks && - this.props.childrenLinks.map((child, ind) => ( - - ))} -
    -
    -
  • - ) - }} - /> - ) - } -} diff --git a/src/ui/components/argit/Sidebar/LinksGroup/package.json b/src/ui/components/argit/Sidebar/LinksGroup/package.json deleted file mode 100644 index a39a2ef..0000000 --- a/src/ui/components/argit/Sidebar/LinksGroup/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "LinksGroup", - "version": "0.0.0", - "private": true, - "main": "./LinksGroup.tsx" -} diff --git a/src/ui/components/argit/Sidebar/Sidebar.module.scss b/src/ui/components/argit/Sidebar/Sidebar.module.scss deleted file mode 100644 index b8be38e..0000000 --- a/src/ui/components/argit/Sidebar/Sidebar.module.scss +++ /dev/null @@ -1,189 +0,0 @@ -@import "../styles/app"; - -.root { - width: $sidebar-width-open; - position: absolute; - left: 0; - top: 0; - bottom: 0; - background-color: $sidebar-bg-color; - color: $sidebar-color; - overflow-y: auto; - margin-left: 15px; - transition: height 1s; - transform: translateX(-$sidebar-width-open); - - @media print { - display: none; - } - - :global(.sidebar-right) & { - left: auto; - right: 0; - margin-left: 0; - margin-right: 15px; - transform: translateX($sidebar-width-open); - } - - :global(.sidebar-hide) & { - display: none; - } - - @include scroll-bar($sidebar-scrollbar-bg); - - @media (max-width: breakpoint-max(sm)) { - position: static !important; - width: 100%; - margin-left: 0; - padding: 0 15px; - height: 0; - transform: none; - - .logo, - .sidebarAlerts, - .sidebarLabels, - .navTitle { - display: none; - } - } -} - -.logo { - margin: -15px 5px 55px; - font-size: 40px; - width: 100%; - font-weight: $font-weight-thin; - text-align: left; - - a { - color: $logo-color; - padding: 0 5px; - text-decoration: none; - white-space: nowrap; - } -} - -.sidebarOpen { - height: auto !important; -} - -.sidebarClose .logo { - width: 50px; -} - -.staticSidebar .logo { - width: 100%; - transition: none; -} - -.nav { - padding-bottom: 10px; - overflow-y: auto; - overflow-x: hidden; -} - -.navTitle { - margin: 35px 0 5px 20px; - font-size: $font-size-larger; - transition: opacity $sidebar-transition-time ease-in-out; - - @media (min-width: breakpoint-min(lg)) { - opacity: 1; - } -} - -.sidebarClose .navTitle { - opacity: 0; -} - -.staticSidebar .navTitle { - opacity: 1; - transition: none; -} - -.actionLink { - color: #aaa; - float: right; - margin-right: 15px; - margin-top: -1px; -} - -.labelName { - opacity: 1; - transition: opacity $sidebar-transition-time ease-in-out; -} - -.sidebarClose .labelName { - opacity: 0; -} - -.staticSidebar .labelName { - transition: none; - opacity: 1; -} - -.glyphiconSm { - font-size: 9px; -} - -.sidebarLabels { - list-style-type: none; - padding: 11px 20px; - padding-right: 15px; - - > li + li { - margin-top: 10px; - } - - li > a { - font-size: $font-size-mini; - color: $sidebar-color; - text-decoration: none; - - > i { - font-size: 11px; - vertical-align: 1px; - transition: margin-left $sidebar-transition-time ease-in-out; - } - } -} - -.sidebarClose { - .sidebarLabels > li > a > i { - margin-left: 8px; - transition: margin-left $sidebar-transition-time ease-in-out; - } -} - -.staticSidebar { - .sidebarLabels > li > a > i { - transition: none; - margin-left: 0; - } -} - -.sidebarAlerts { - margin-bottom: $spacer * 2; - transition: opacity $sidebar-transition-time ease-in-out; - opacity: 1; -} - -.sidebarClose .sidebarAlerts { - opacity: 0; -} - -.staticSidebar .sidebarAlerts { - opacity: 1; - transition: none; -} - -.sidebarAlert { - background: transparent; - margin-bottom: 0; - padding: 0.5rem 11px 0.5rem 20px !important; - padding-right: 15px; -} - -.groupTitle { - margin-bottom: 15px; -} diff --git a/src/ui/components/argit/Sidebar/Sidebar.module.scss.d.ts b/src/ui/components/argit/Sidebar/Sidebar.module.scss.d.ts deleted file mode 100644 index bfc1793..0000000 --- a/src/ui/components/argit/Sidebar/Sidebar.module.scss.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export interface ISidebarModuleScss { - 'root': string; - 'logo': string; - 'sidebarAlerts': string; - 'sidebarLabels': string; - 'navTitle': string; - 'sidebarOpen': string; - 'sidebarClose': string; - 'staticSidebar': string; - 'nav': string; - 'actionLink': string; - 'labelName': string; - 'glyphiconSm': string; - 'sidebarAlert': string; - 'groupTitle': string; -} - -export const locals: ISidebarModuleScss; diff --git a/src/ui/components/argit/Sidebar/Sidebar.tsx b/src/ui/components/argit/Sidebar/Sidebar.tsx deleted file mode 100644 index 1eb813e..0000000 --- a/src/ui/components/argit/Sidebar/Sidebar.tsx +++ /dev/null @@ -1,120 +0,0 @@ -import cx from "classnames" -import React from "react" -import { Link } from "react-router-dom" -import { lifecycle } from "recompose" -import { connector } from "../../../actionCreators/index" -import { changeActiveSidebarItem } from "../../../reducers/navigation" -import LinksGroup from "./LinksGroup/LinksGroup" -import s from "./Sidebar.module.scss" -import dlogo from "../../argit/images/logosv.svg" - -export interface SidebarProps { - sidebarOpened: boolean - activeItem: string - location: { pathname: string } - changeActiveSidebarItem: typeof changeActiveSidebarItem -} - -export const Sidebar = connector( - state => ({ - sidebarOpened: state.navigation.sidebarOpened, - activeItem: state.navigation.activeItem, - isAuthenticated: state.argit.isAuthenticated - }), - actions => ({ - changeActiveSidebarItem: actions.navigation.changeActiveSidebarItem - }), - lifecycle({ - componentWillReceiveProps(nextProps) { - if (nextProps.sidebarOpened !== this.props.sidebarOpened) { - if (nextProps.sidebarOpened) { - // this.element.style.height = `${this.element.scrollHeight}px` - } else { - // this.element.classList.remove(s.sidebarOpen) - setTimeout(() => { - // this.element.style.height = "" - }, 0) - } - } - } - }) -)(function SidebarImpl(props) { - return ( - - ) -}) diff --git a/src/ui/components/argit/Sidebar/package.json b/src/ui/components/argit/Sidebar/package.json deleted file mode 100644 index 1d359b5..0000000 --- a/src/ui/components/argit/Sidebar/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Sidebar", - "version": "0.0.0", - "private": true, - "main": "./Sidebar.tsx" -} diff --git a/src/ui/components/argit/Widget/Widget.module.scss b/src/ui/components/argit/Widget/Widget.module.scss deleted file mode 100644 index dd531a7..0000000 --- a/src/ui/components/argit/Widget/Widget.module.scss +++ /dev/null @@ -1,339 +0,0 @@ -@import "../styles/app"; - -.title { - margin-top: 0; - color: $widget-title-color; - padding: 15px 20px 0; - - @include clearfix(); -} - -:global .h-100 { - height: 100%; -} - -.reloading { - min-height: 150px; -} - -.widgetBackground { - position: fixed; - display: none; - top: 0px; - left: 0; - width: 100vw; - height: 100vh; - background-color: #f8f8fa; - background-image: linear-gradient(315deg, #f8f8fa 0%, #f8f8fa 74%); - background-repeat: no-repeat; - background-size: cover; - z-index: 55; -} - -:global .fullscreened { - position: fixed !important; - top: 50%; - right: 0px; - bottom: 0px; - height: 60vh; - left: 50%; - margin: 0px; - z-index: 10000; - transform: translate(-50%, -50%) !important; -} - -@media (max-width: 1400px) { - :global .fullscreened { - position: fixed !important; - top: 50%; - height: 70vh; - right: 0px; - bottom: 0px; - left: 50%; - margin: 0px; - z-index: 10000; - transform: translate(-50%, -50%) !important; - } -} - -@media (max-width: 992px) { - :global .fullscreened { - position: fixed !important; - top: 50%; - height: 90vh; - width: 90vw; - right: 0px; - bottom: 0px; - left: 50%; - margin: 0px; - z-index: 10000; - transform: translate(-50%, -50%) !important; - } -} - -:global .widget.collapsed { - > header { - transition: padding 0.3s linear; - transition-delay: 0.2s; - padding: $widget-padding-vertical $widget-padding-horizontal; - } - > h5 { - transition: padding 0.3s, margin-bottom 0.3s linear; - transition-delay: 0.2s; - padding: $widget-padding-vertical $widget-padding-horizontal; - margin-bottom: 0; - } -} - -.widget { - color: $content-color; - display: block; - position: relative; - margin-bottom: $grid-gutter-width; - border-radius: $widget-border-radius; - background: $widget-bg-color; - box-shadow: $widget-shadow; - > header { - transition: padding 0.3s linear; - padding: $widget-padding-vertical $widget-padding-horizontal 0; - color: $text-color; - h1, - h2, - h3, - h4, - h5, - h6 { - margin: 0; - color: $text-color; - } - } - - :global { - .loader { - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - - .spinner { - position: absolute; - top: 50%; - width: 100%; //ie fix - margin-top: -10px; - font-size: 20px; - text-align: center; - } - } - .widget-body.undo_padding { - margin: $widget-padding-vertical (-$widget-padding-horizontal) - (-$widget-padding-vertical); - - + footer { - margin-top: $widget-padding-vertical; - } - } - } - - &:global.bg-transparent { - box-shadow: none; - } -} -.widget { - &:global.p-0 .widget-body { - padding: 0 !important; - } -} - -.widgetBody { - @include clearfix(); - padding: $widget-padding-vertical $widget-padding-horizontal; - - > footer { - margin: $spacer/2 (-$widget-padding-horizontal) (-$widget-padding-vertical); - padding: 10px 20px; - border-bottom-left-radius: $widget-border-radius; - border-bottom-right-radius: $widget-border-radius; - } -} - -.widgetControls + .widgetBody { - margin-top: $widget-padding-vertical; -} - -.widgetControls + .widgetBody.widgetCollapsing { - margin-top: 0; -} - -.customControlItem { - cursor: pointer; -} - -.widgetControls, -:global(.widget-controls) { - position: absolute; - z-index: 50; - top: 0; - right: 0; - display: flex; - padding: 14px; - font-size: $font-size-sm; - - & > div { - display: flex; - } - - button { - display: flex; - padding: 1px 4px; - border-radius: 4px; - color: $white; - background: transparent; - border: none; - cursor: pointer; - - @include transition(color 0.15s ease-in-out); - - &:hover { - color: rgba($white, 0.75); - text-decoration: none; - } - - &:active, - &:focus { - outline: none; - } - - :global { - .la { - position: relative; - top: 2px; - } - - .glyphicon { - font-size: 0.7rem; - } - } - } -} - -.inverse { - top: 2px; - position: relative; - margin-left: 3px; - - :global { - .glyphicon { - vertical-align: baseline; - } - } -} - -:global { - .widget-image { - position: relative; - overflow: hidden; - margin: (-$widget-padding-vertical) (-$widget-padding-horizontal); - border-radius: $border-radius; - - > img { - max-width: 100%; - border-radius: $border-radius $border-radius 0 0; - transition: transform 0.15s ease; - } - - &:hover > img { - transform: scale(1.1, 1.1); - } - - .title { - position: absolute; - top: 0; - left: 0; - margin: 20px; - } - - .info { - position: absolute; - top: 0; - right: 0; - margin: 20px; - } - } - - .widget-footer-bottom { - position: absolute; - bottom: 0; - width: 100%; - } - - .widget-sm { - height: 230px; - } - - .widget-md { - height: 373px; - } - - .widget-padding-md { - padding: $widget-padding-vertical $widget-padding-horizontal; - } - - .widget-padding-lg { - padding: $widget-padding-vertical * 2 $widget-padding-horizontal * 2; - } - - .widget-body-container { - // position: relative; - height: 100%; - } - - .widget-top-overflow, - .widget-middle-overflow { - position: relative; - margin: 0 (-$widget-padding-horizontal); - - > img { - max-width: 100%; - } - } - - .widget-top-overflow { - margin-top: (-$widget-padding-vertical); - border-top-left-radius: $widget-border-radius; - border-top-right-radius: $widget-border-radius; - overflow: hidden; - - > img { - border-top-left-radius: $widget-border-radius; - border-top-right-radius: $widget-border-radius; - } - - > .btn-toolbar { - position: absolute; - top: 0; - right: 0; - z-index: 1; - margin-right: $widget-padding-horizontal; - - @include media-breakpoint-up(md) { - top: auto; - bottom: 0; - } - } - } - - .widget-icon { - opacity: 0.5; - font-size: 42px; - height: 60px; - line-height: 45px; - display: inline-block; - } -} - -.widgetLoader { - position: absolute; - top: 0; - left: 0; -} diff --git a/src/ui/components/argit/Widget/Widget.module.scss.d.ts b/src/ui/components/argit/Widget/Widget.module.scss.d.ts deleted file mode 100644 index 398e5fb..0000000 --- a/src/ui/components/argit/Widget/Widget.module.scss.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface IWidgetModuleScss { - 'title': string; - 'reloading': string; - 'widgetBackground': string; - 'widget': string; - 'widgetBody': string; - 'widgetControls': string; - 'widgetCollapsing': string; - 'customControlItem': string; - 'inverse': string; - 'widgetLoader': string; -} - -export const locals: IWidgetModuleScss; diff --git a/src/ui/components/argit/Widget/Widget.tsx b/src/ui/components/argit/Widget/Widget.tsx deleted file mode 100644 index c768153..0000000 --- a/src/ui/components/argit/Widget/Widget.tsx +++ /dev/null @@ -1,480 +0,0 @@ -import classNames from "classnames" -import * as React from "react" -import AnimateHeight from "react-animate-height" -import { - Button, - DropdownItem, - DropdownMenu, - DropdownToggle, - Modal, - ModalBody, - ModalFooter, - ModalHeader, - UncontrolledDropdown, - UncontrolledTooltip -} from "reactstrap" -import { v4 as uuidv4 } from "uuid" -import Loader from "../Loader/Loader" // eslint-disable-line css-modules/no-unused-class -import s from "./Widget.module.scss" - -export interface WidgetProps { - title: any - className: string - children: any - close: boolean | string - fullscreen: boolean - collapse: boolean - refresh: boolean | string - settings: boolean - settingsInverse: boolean - tooltipPlacement: string - showTooltip: boolean - bodyClass: string - customControls: boolean - options: object //eslint-disable-line, - fetchingData: boolean - prompt: boolean - collapsed: boolean - widgetType: string - customClose: any - customExpand: any - customCollapse: any - customFullscreen: any - customReload: any - customDropDown: any - customBody: any - updateWidgetData: any - handleReload: any -} - -export interface WidgetState { - randomId: any - hideWidget: boolean - collapseWidget: any - height: any - fullscreened: boolean - reloading: boolean - modal: boolean - apiData: string -} - -class Widget extends React.Component { - constructor(props: WidgetProps) { - super(props) - - this.state = { - randomId: uuidv4(), - hideWidget: false, - collapseWidget: !!props.collapsed, - height: props.collapsed ? 0 : "auto", - fullscreened: false, - reloading: false, - modal: false, - apiData: "" - } - this.handleClose.bind(this) - } - toggleModal = () => { - this.setState({ modal: !this.state.modal }) - } - - handleClose = () => { - this.setState({ hideWidget: !this.state.hideWidget }) - } - - handleCollapse = () => { - let heightValue = this.state.collapseWidget ? "auto" : 0 - this.setState({ - height: heightValue, - collapseWidget: !this.state.collapseWidget, - reloading: false - }) - } - - closeWithModal = () => { - this.toggleModal() - this.handleClose() - } - - handleExpand = () => { - this.setState({ - height: "auto", - collapseWidget: false - }) - } - - handleReload = () => { - const { widgetType, updateWidgetData } = this.props - const type = widgetType - if (type) { - updateWidgetData(type) - } - this.setState({ reloading: true }) - let endpoint = false - if (!endpoint) { - setTimeout(() => this.setState({ reloading: false }), 2000) - } else { - this.setState({ reloading: true }) - fetch("https://yourapi.com") - .then(response => response.json()) - .then(json => this.setState({ apiData: json.title })) - .then(setTimeout(() => this.setState({ reloading: false }), 1000)) - } - } - - handleFullscreen = () => { - this.setState({ fullscreened: !this.state.fullscreened }) - } - // state = { : } - render() { - const { - title, - className, - children, - close, - fullscreen, - collapse, - refresh, - settings, - settingsInverse, - tooltipPlacement, - showTooltip, - bodyClass, - customControls, - customClose, - customExpand, - customCollapse, - customFullscreen, - customReload, - fetchingData, - customDropDown, - customBody, - prompt, - collapsed, - widgetType, - updateWidgetData, - options, //eslint-disable-line - ...attributes - } = this.props - const mainControls = !!( - close || - fullscreen || - collapse || - refresh || - settings || - settingsInverse - ) - - const { - reloading, - fullscreened, - randomId, - height, - hideWidget, - collapseWidget, - modal - } = this.state - - return ( - -
    - {title && - (typeof title === "string" ? ( -
    {title}
    - ) : ( -
    {title}
    - ))} - - {!customControls && - mainControls && ( -
    - {settings && ( - - )} - {settingsInverse && ( - - )} - {refresh && ( - - )} - {fullscreen && ( - - )} - {!fullscreened && - collapse && ( - - - - )} - {!fullscreened && - (close && !prompt ? ( - - ) : ( - - ))} -
    - )} - {customDropDown && ( -
    - - - - - - - Reload    - - 9 - - - - - {!fullscreened ? "Fullscreen" : "Restore"}{" "} - - - {!fullscreened && - (!prompt ? ( - - Close - - ) : ( - - Close - - ))} - - -
    - )} - {customControls && ( -
    - {!fullscreened && - (customClose && !prompt ? ( - - ) : ( - - ))} - {!fullscreened && - (customCollapse && ( - - ))} - {customFullscreen && ( - - )} - {customReload && ( - - )} -
    - )} - -
    - {reloading || fetchingData ? ( - - ) : customBody ? ( -
    -
    -

    Draggable story!

    -

    - Build your own interfaces! Sit back and relax. -

    -

    - -

    -
    -
    - ) : ( - children - )} -
    -
    -
    - {prompt && ( - - - Sure? - - - Do you really want to unrevertably remove this super news widget? - - - {" "} - - - - )} -
    - - ) - } -} - -export default Widget diff --git a/src/ui/components/argit/Widget/package.json b/src/ui/components/argit/Widget/package.json deleted file mode 100644 index fd43104..0000000 --- a/src/ui/components/argit/Widget/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Widget", - "version": "0.0.0", - "private": true, - "main": "./Widget.tsx" -} diff --git a/src/ui/components/argit/cloneButton.tsx b/src/ui/components/argit/cloneButton.tsx deleted file mode 100644 index 6c6045a..0000000 --- a/src/ui/components/argit/cloneButton.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import * as React from "react" -import { - Button, - PopoverBody, - PopoverHeader, - UncontrolledPopover -} from "reactstrap" -import { connector } from "../../actionCreators/index" - -type CloneButtonProps = { - address: string - projectRoot: string -} - -export const CloneButton = connector( - state => ({ - address: state.argit.address, - projectRoot: state.project.projectRoot - }), - actions => ({}) -)(function CloneButtonImpl(props: CloneButtonProps) { - const url = `dgit://${props.address}${props.projectRoot}` - - return ( - <> - - - Clone with argit - {url} - - - ) -}) diff --git a/src/ui/components/argit/commits.tsx b/src/ui/components/argit/commits.tsx index aa79630..f516bb5 100644 --- a/src/ui/components/argit/commits.tsx +++ b/src/ui/components/argit/commits.tsx @@ -8,16 +8,10 @@ import { arweave } from "../../../index" import { getOidByRef } from "isomorphic-git/src/utils/arweave" import { createNewProject } from "../../reducers/project" import { updateCommits } from "../../reducers/git" -import NewContainer, { Icon, List } from "../argit/Repository/Container" import { - Owner, - OwnerProfile, - RepoInfo, Loading, PageNav } from "../argit/Repository/RepositoryStyles" -import dlogo from "../argit/images/dlogo.svg" -import { Link } from "react-router-dom" import * as git from "isomorphic-git" function compareAge(a, b) { diff --git a/src/ui/components/argit/images/dgitlogo.tsx b/src/ui/components/argit/images/dgitlogo.tsx deleted file mode 100644 index 3f98357..0000000 --- a/src/ui/components/argit/images/dgitlogo.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import * as React from "react" - -function DgitLogo() { - return ( - - - - - - - - - - - - - - - - - - - ) -} - -export default DgitLogo diff --git a/src/ui/components/argit/images/hero.svg b/src/ui/components/argit/images/hero.svg deleted file mode 100644 index 3e63467..0000000 --- a/src/ui/components/argit/images/hero.svg +++ /dev/null @@ -1,2 +0,0 @@ - -developer activity \ No newline at end of file diff --git a/src/ui/components/argit/images/hero2.svg b/src/ui/components/argit/images/hero2.svg deleted file mode 100644 index 031e3df..0000000 --- a/src/ui/components/argit/images/hero2.svg +++ /dev/null @@ -1 +0,0 @@ -code typing \ No newline at end of file diff --git a/src/ui/components/argit/images/heromain.svg b/src/ui/components/argit/images/heromain.svg deleted file mode 100644 index fc1720d..0000000 --- a/src/ui/components/argit/images/heromain.svg +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ui/components/argit/images/logo.png b/src/ui/components/argit/images/logo.png deleted file mode 100644 index 61e0f29..0000000 Binary files a/src/ui/components/argit/images/logo.png and /dev/null differ diff --git a/src/ui/components/argit/images/logos.svg b/src/ui/components/argit/images/logos.svg deleted file mode 100644 index a5b9d11..0000000 --- a/src/ui/components/argit/images/logos.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/ui/components/argit/images/microsoft.png b/src/ui/components/argit/images/microsoft.png deleted file mode 100644 index 61196f5..0000000 Binary files a/src/ui/components/argit/images/microsoft.png and /dev/null differ diff --git a/src/ui/components/argit/images/people/a3.jpg b/src/ui/components/argit/images/people/a3.jpg deleted file mode 100644 index 451a0b4..0000000 Binary files a/src/ui/components/argit/images/people/a3.jpg and /dev/null differ diff --git a/src/ui/components/argit/images/people/a5.jpg b/src/ui/components/argit/images/people/a5.jpg deleted file mode 100644 index 45061e9..0000000 Binary files a/src/ui/components/argit/images/people/a5.jpg and /dev/null differ diff --git a/src/ui/components/argit/images/pr.svg b/src/ui/components/argit/images/pr.svg deleted file mode 100644 index f062242..0000000 --- a/src/ui/components/argit/images/pr.svg +++ /dev/null @@ -1 +0,0 @@ -pull_request \ No newline at end of file diff --git a/src/ui/components/argit/images/undraw_version_control_9bpv.png b/src/ui/components/argit/images/undraw_version_control_9bpv.png deleted file mode 100644 index e49bdaa..0000000 Binary files a/src/ui/components/argit/images/undraw_version_control_9bpv.png and /dev/null differ diff --git a/src/ui/components/argit/logo.svg b/src/ui/components/argit/logo.svg deleted file mode 100644 index 4d43412..0000000 --- a/src/ui/components/argit/logo.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - logo - Created with Sketch. - - - - - \ No newline at end of file diff --git a/src/ui/components/argit/styles/theme.scss b/src/ui/components/argit/styles/theme.scss index fb9d349..00dd4c5 100644 --- a/src/ui/components/argit/styles/theme.scss +++ b/src/ui/components/argit/styles/theme.scss @@ -5,10 +5,6 @@ @import "../../../../../node_modules/bootstrap/scss/functions"; @import "variables"; @import "../../../../../node_modules/bootstrap/scss/bootstrap"; -// @import "../../../../../node_modules/line-awesome/dist/line-awesome/css/line-awesome.css"; -@import "../../../../../node_modules/animate.css/animate"; -@import "../../../../../node_modules/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox"; -@import "../../../../../node_modules/rickshaw/rickshaw.css"; @import "../../../../../node_modules/react-toastify/dist/ReactToastify.css"; @import "mixins"; diff --git a/src/ui/components/atoms/Entry.tsx b/src/ui/components/atoms/Entry.tsx deleted file mode 100644 index 89a8127..0000000 --- a/src/ui/components/atoms/Entry.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { Card } from "@blueprintjs/core" -import React from "react" -import pkg from "../../../../package.json" -import { PluginEntryArea } from "./PluginEntryArea" - -export class Entry extends React.Component { - render() { - return ( - -
    -

    dgit v{pkg.version}

    -

    - This is pre alpha version. There is a possibility you lose data by - upgrade without notice -

    - - -
    -
    - ) - } -} diff --git a/src/ui/components/atoms/NavgatorTitle.tsx b/src/ui/components/atoms/NavgatorTitle.tsx deleted file mode 100644 index 9152beb..0000000 --- a/src/ui/components/atoms/NavgatorTitle.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { Icon, Position, Tooltip } from "@blueprintjs/core" -import React from "react" -import { Link } from "react-router-dom" - -export function NavigatorTitle(props: { networkOnline: boolean }) { - return ( - <> - - dgit   - - - - - - ) -} diff --git a/src/ui/components/atoms/PluginEntryArea.tsx b/src/ui/components/atoms/PluginEntryArea.tsx deleted file mode 100644 index bb40d27..0000000 --- a/src/ui/components/atoms/PluginEntryArea.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { Card } from "@blueprintjs/core" -import React from "react" - -export class PluginEntryArea extends React.Component { - render() { - return ( - <> - {Object.keys(NEPlugins).map(pluginName => { - const plugin = NEPlugins[pluginName] - const Entry = plugin.EntryPageComponent - return ( - -

    - Plugin: - {pluginName} -

    - {Entry && } -
    - ) - })} - - ) - } -} - -class PluginErrorBoundary extends React.Component< - {}, - { hasError: boolean; error: Error | null; info: any } -> { - state = { hasError: false, error: null, info: null } - componentDidCatch(error: Error, info: any) { - this.setState({ hasError: true, error, info }) - console.error(error, info) - } - render() { - const { hasError, error, info } = this.state - if (hasError && error && info) { - return ( -
    -

    Plugin Loading Error: {error && (error as any).message}

    -
    - ) - } else { - return this.props.children - } - } -} diff --git a/src/ui/components/atoms/Root.tsx b/src/ui/components/atoms/Root.tsx deleted file mode 100644 index 9cccc73..0000000 --- a/src/ui/components/atoms/Root.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import styled from "styled-components" -import darkTheme from "../../themes/dark" - -export const Root = styled.div` - width: 100vw; - height: 100vw; - background: ${p => darkTheme.main}; - color: ${p => darkTheme.textColor}; - padding: 0; - margin: 0; -` -Root.displayName = "Root" diff --git a/src/ui/components/pages/Config.tsx b/src/ui/components/pages/Config.tsx deleted file mode 100644 index a80cfb2..0000000 --- a/src/ui/components/pages/Config.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import * as React from "react" -import { connector } from "../../actionCreators" -import { Root } from "../atoms/Root" -import { Config as ConfigContent } from "../organisms/Config" -import { GlobalHeader } from "../organisms/GlobalHeader" -import { Grid, GridArea } from "../utils/Grid" - -export const Config = connector( - state => ({ - config: state.config - }), - actions => { - return { - setConfigValue: actions.config.setConfigValue, - popScene: actions.app.popScene - } - } -)(function ConfigImpl(props) { - return ( - - {/* prettier-ignore */} - - - - - - props.popScene({})} - onChangeConfigValue={(key, value) => { - props.setConfigValue({key, value}) - }} - /> - - - - ) -}) diff --git a/src/ui/components/pages/Edit.tsx b/src/ui/components/pages/Edit.tsx deleted file mode 100644 index 630aa50..0000000 --- a/src/ui/components/pages/Edit.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import * as React from "react" -import { Root } from "../atoms/Root" -import { EditFooter } from "../organisms/EditFooter" -import { Editor } from "../organisms/Editor" -import { GlobalHeader } from "../organisms/GlobalHeader" -import { Grid, GridArea } from "../utils/Grid" - -export function Edit() { - return ( - - {/* prettier-ignore */} - - - - - - - - - - - - - - ) -} diff --git a/src/ui/components/utils/StackRouter.tsx b/src/ui/components/utils/StackRouter.tsx index f2159c3..e1e2c87 100644 --- a/src/ui/components/utils/StackRouter.tsx +++ b/src/ui/components/utils/StackRouter.tsx @@ -4,13 +4,11 @@ import * as git from "isomorphic-git" import * as pkg from "isomorphic-git/src/utils/arweave" const { getOidByRef } = pkg import { fetchGitObject } from "isomorphic-git/src/utils/arweave" -import React, { lazy, Suspense } from "react" -import { Link } from "react-router-dom" +import React from "react" import { CardBody, Col, Row, Container } from "reactstrap" import { lifecycle } from "recompose" import { ReadCommitResult } from "../../../domain/types" import { arweave } from "../../../index" -import dlogo from "../argit/images/dlogo.svg" import { connector } from "../../actionCreators" import { @@ -27,23 +25,8 @@ import { } from "../../reducers/argit" import { createNewProject } from "../../reducers/project" import { RepositoryBrowser } from "../organisms/RepositoryBrowser" -import { Sponsor } from "../argit/Sponsor" -import NewContainer, { Icon } from "../argit/Repository/Container" -import { - Button, - PopoverBody, - PopoverHeader, - UncontrolledPopover -} from "reactstrap" import { Loading, - Owner, - IssueList, - FilterList, - PageNav, - OwnerProfile, - RepoInfo, - IssueLabel } from "../argit/Repository/RepositoryStyles" import { mkdir } from "../../../domain/filesystem/commands/mkdir" import pify from "pify" diff --git a/tsconfig.json b/tsconfig.json index 65279a1..e26be95 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -59,7 +59,6 @@ "include": [ "src/**/*", "decls.d.ts", - "src-custom/**/*.ts", "src/ui/components/argit/**/*.d.ts" ], "exclude": ["node_modules/browserfs/**/*.d.ts"]