mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 06:35:32 +03:00
Merge pull request #3308 from urbit/la/outer-restructure
interface: restructured outer directories into views and logic
This commit is contained in:
commit
bb1a4d73b2
@ -1,7 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import * as ReactDOM from 'react-dom';
|
||||
|
||||
// import "./fonts/font.css";
|
||||
import App from './App';
|
||||
import App from './views/App';
|
||||
|
||||
ReactDOM.render(<App />, document.getElementById('root'));
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { roleTags, RoleTags, Group, Resource } from '../types/group-update';
|
||||
import { PatpNoSig, Path } from '../types/noun';
|
||||
import { roleTags, RoleTags, Group, Resource } from '../../types/group-update';
|
||||
import { PatpNoSig, Path } from '../../types/noun';
|
||||
|
||||
|
||||
export function roleForShip(group: Group, ship: PatpNoSig): RoleTags | undefined {
|
@ -1,8 +1,8 @@
|
||||
import _ from 'lodash';
|
||||
import { StoreState } from '../store/type';
|
||||
import { Cage } from '../types/cage';
|
||||
import { ChatUpdate } from '../types/chat-update';
|
||||
import { ChatHookUpdate } from '../types/chat-hook-update';
|
||||
import { StoreState } from '../../../store/type';
|
||||
import { Cage } from '../../types/cage';
|
||||
import { ChatUpdate } from '../../types/chat-update';
|
||||
import { ChatHookUpdate } from '../../types/chat-hook-update';
|
||||
|
||||
type ChatState = Pick<StoreState, 'chatInitialized' | 'chatSynced' | 'inbox' | 'pendingMessages'>;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import _ from 'lodash';
|
||||
import { StoreState } from '../store/type';
|
||||
import { Cage } from '../types/cage';
|
||||
import { StoreState } from '../../store/type';
|
||||
import { Cage } from '../../types/cage';
|
||||
|
||||
type LocalState = Pick<StoreState, 'connection'>;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import _ from 'lodash';
|
||||
import { StoreState } from '../store/type';
|
||||
import { Cage } from '../types/cage';
|
||||
import { ContactUpdate } from '../types/contact-update';
|
||||
import { StoreState } from '../../store/type';
|
||||
import { Cage } from '../../types/cage';
|
||||
import { ContactUpdate } from '../../types/contact-update';
|
||||
|
||||
type ContactState = Pick<StoreState, 'contacts'>;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import _ from 'lodash';
|
||||
import { StoreState } from '../store/type';
|
||||
import { Cage } from '../types/cage';
|
||||
import { StoreState } from '../../store/type';
|
||||
import { Cage } from '../../types/cage';
|
||||
import {
|
||||
GroupUpdate,
|
||||
Group,
|
||||
@ -11,8 +11,8 @@ import {
|
||||
OpenPolicy,
|
||||
InvitePolicyDiff,
|
||||
InvitePolicy,
|
||||
} from '../types/group-update';
|
||||
import { Enc, PatpNoSig } from '../types/noun';
|
||||
} from '../../types/group-update';
|
||||
import { Enc, PatpNoSig } from '../../types/noun';
|
||||
import { resourceAsPath } from '../lib/util';
|
||||
|
||||
type GroupState = Pick<StoreState, 'groups' | 'groupKeys'>;
|
@ -1,7 +1,7 @@
|
||||
import _ from 'lodash';
|
||||
import { StoreState } from '../store/type';
|
||||
import { Cage } from '../types/cage';
|
||||
import { InviteUpdate } from '../types/invite-update';
|
||||
import { StoreState } from '../../store/type';
|
||||
import { Cage } from '../../types/cage';
|
||||
import { InviteUpdate } from '../../types/invite-update';
|
||||
|
||||
type InviteState = Pick<StoreState, "invites">;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import _ from 'lodash';
|
||||
import { LaunchUpdate } from '../types/launch-update';
|
||||
import { Cage } from '../types/cage';
|
||||
import { StoreState } from '../store/type';
|
||||
import { LaunchUpdate } from '../../types/launch-update';
|
||||
import { Cage } from '../../types/cage';
|
||||
import { StoreState } from '../../store/type';
|
||||
|
||||
type LaunchState = Pick<StoreState, 'launch' | 'weather' | 'userLocation'>;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import _ from 'lodash';
|
||||
import { StoreState } from '../store/type';
|
||||
import { LinkUpdate, Pagination } from '../types/link-update';
|
||||
import { StoreState } from '../../store/type';
|
||||
import { LinkUpdate, Pagination } from '../../types/link-update';
|
||||
|
||||
// page size as expected from link-view.
|
||||
// must change in parallel with the +page-size in /app/link-view to
|
@ -1,7 +1,7 @@
|
||||
import _ from 'lodash';
|
||||
import { StoreState } from '../store/type';
|
||||
import { Cage } from '../types/cage';
|
||||
import { LinkListenUpdate } from '../types/link-listen-update';
|
||||
import { StoreState } from '../../store/type';
|
||||
import { Cage } from '../../types/cage';
|
||||
import { LinkListenUpdate } from '../../types/link-listen-update';
|
||||
|
||||
type LinkListenState = Pick<StoreState, 'linkListening'>;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import _ from 'lodash';
|
||||
import { StoreState } from '../store/type';
|
||||
import { Cage } from '../types/cage';
|
||||
import { LocalUpdate } from '../types/local-update';
|
||||
import { StoreState } from '../../store/type';
|
||||
import { Cage } from '../../types/cage';
|
||||
import { LocalUpdate } from '../../types/local-update';
|
||||
|
||||
type LocalState = Pick<StoreState, 'sidebarShown' | 'omniboxShown' | 'dark' | 'baseHash'>;
|
||||
|
@ -1,9 +1,9 @@
|
||||
import _ from 'lodash';
|
||||
|
||||
import { StoreState } from '../store/type';
|
||||
import { StoreState } from '../../store/type';
|
||||
|
||||
import { MetadataUpdate } from '../types/metadata-update';
|
||||
import { Cage } from '../types/cage';
|
||||
import { MetadataUpdate } from '../../types/metadata-update';
|
||||
import { Cage } from '../../types/cage';
|
||||
|
||||
type MetadataState = Pick<StoreState, 'associations'>;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import _ from 'lodash';
|
||||
import { StoreState } from '../store/type';
|
||||
import { Cage } from '../types/cage';
|
||||
import { PermissionUpdate } from '../types/permission-update';
|
||||
import { StoreState } from '../../store/type';
|
||||
import { Cage } from '../../types/cage';
|
||||
import { PermissionUpdate } from '../../types/permission-update';
|
||||
|
||||
type PermissionState = Pick<StoreState, "permissions">;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import _ from 'lodash';
|
||||
import { StoreState } from '../store/type';
|
||||
import { Cage } from '../types/cage';
|
||||
import { StoreState } from '../../store/type';
|
||||
import { Cage } from '../../types/cage';
|
||||
|
||||
type PublishState = Pick<StoreState, 'notebooks'>;
|
||||
|
@ -1,9 +1,9 @@
|
||||
import _ from 'lodash';
|
||||
|
||||
import { PublishUpdate } from '../types/publish-update';
|
||||
import { Cage } from '../types/cage';
|
||||
import { StoreState } from '../store/type';
|
||||
import { getTagFromFrond } from '../types/noun';
|
||||
import { PublishUpdate } from '../../types/publish-update';
|
||||
import { Cage } from '../../types/cage';
|
||||
import { StoreState } from '../../store/type';
|
||||
import { getTagFromFrond } from '../../types/noun';
|
||||
|
||||
type PublishState = Pick<StoreState, 'notebooks'>;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import _ from 'lodash';
|
||||
import { StoreState } from '../store/type';
|
||||
import { Cage } from '../types/cage';
|
||||
import { S3Update } from '../types/s3-update';
|
||||
import { StoreState } from '../../store/type';
|
||||
import { Cage } from '../../types/cage';
|
||||
import { S3Update } from '../../types/s3-update';
|
||||
|
||||
type S3State = Pick<StoreState, 's3'>;
|
||||
|
@ -18,11 +18,11 @@ import StatusBar from './components/StatusBar';
|
||||
import Omnibox from './components/Omnibox';
|
||||
import ErrorComponent from './components/Error';
|
||||
|
||||
import GlobalStore from './store/store';
|
||||
import GlobalSubscription from './subscription/global';
|
||||
import GlobalApi from './api/global';
|
||||
import { uxToHex } from './lib/util';
|
||||
import { Sigil } from './lib/sigil';
|
||||
import GlobalStore from '../logic/store/store';
|
||||
import GlobalSubscription from '../logic/subscription/global';
|
||||
import GlobalApi from '../logic/api/global';
|
||||
import { uxToHex } from '../logic/lib/util';
|
||||
import { Sigil } from '../logic/lib/sigil';
|
||||
|
||||
const Root = styled.div`
|
||||
font-family: ${p => p.theme.fonts.sans};
|
@ -11,11 +11,11 @@ import { SettingsScreen } from './components/settings';
|
||||
import { NewScreen } from './components/new';
|
||||
import { JoinScreen } from './components/join';
|
||||
import { NewDmScreen } from './components/new-dm';
|
||||
import { PatpNoSig } from '../../types/noun';
|
||||
import GlobalApi from '../../api/global';
|
||||
import { StoreState } from '../../store/type';
|
||||
import GlobalSubscription from '../../subscription/global';
|
||||
import {groupBunts} from '../../types/group-update';
|
||||
import { PatpNoSig } from '../../../types/noun';
|
||||
import GlobalApi from '../../logic/api/global';
|
||||
import { StoreState } from '../../logic/store/type';
|
||||
import GlobalSubscription from '../../logic/subscription/global';
|
||||
import {groupBunts} from '../../../types/group-update';
|
||||
|
||||
type ChatAppProps = StoreState & {
|
||||
ship: PatpNoSig;
|
@ -6,15 +6,15 @@ import { Link, RouteComponentProps } from "react-router-dom";
|
||||
import { ChatWindow } from './lib/chat-window';
|
||||
import { ChatHeader } from './lib/chat-header';
|
||||
import { ChatInput } from "./lib/chat-input";
|
||||
import { deSig } from "../../../lib/util";
|
||||
import { ChatHookUpdate } from "../../../types/chat-hook-update";
|
||||
import ChatApi from "../../../api/chat";
|
||||
import { Inbox, Envelope } from "../../../types/chat-update";
|
||||
import { Contacts } from "../../../types/contact-update";
|
||||
import { Path, Patp } from "../../../types/noun";
|
||||
import GlobalApi from "../../../api/global";
|
||||
import { Association } from "../../../types/metadata-update";
|
||||
import {Group} from "../../../types/group-update";
|
||||
import { deSig } from "../../../../logic/lib/util";
|
||||
import { ChatHookUpdate } from "../../../../types/chat-hook-update";
|
||||
import ChatApi from "../../../../logic/api/chat";
|
||||
import { Inbox, Envelope } from "../../../../types/chat-update";
|
||||
import { Contacts } from "../../../../types/contact-update";
|
||||
import { Path, Patp } from "../../../../types/noun";
|
||||
import GlobalApi from "../../../../logic/api/global";
|
||||
import { Association } from "../../../../types/metadata-update";
|
||||
import {Group} from "../../../../types/group-update";
|
||||
|
||||
|
||||
type ChatScreenProps = RouteComponentProps<{
|
@ -3,7 +3,7 @@ import { Link } from "react-router-dom";
|
||||
|
||||
import { ChatTabBar } from "./chat-tabbar";
|
||||
import { SidebarSwitcher } from "../../../../components/SidebarSwitch";
|
||||
import { deSig } from "../../../../lib/util";
|
||||
import { deSig } from "../../../../../logic/lib/util";
|
||||
|
||||
|
||||
export const ChatHeader = (props) => {
|
@ -1,8 +1,9 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Sigil } from '../../../../lib/sigil';
|
||||
import ChatEditor from './chat-editor';
|
||||
import { S3Upload } from './s3-upload';
|
||||
import { uxToHex } from '../../../../lib/util';
|
||||
import { S3Upload } from './s3-upload'
|
||||
;
|
||||
import { uxToHex } from '../../../../../logic/lib/util';
|
||||
import { Sigil } from '../../../../../logic/lib/sigil';
|
||||
|
||||
|
||||
const URL_REGEX = new RegExp(String(/^((\w+:\/\/)[-a-zA-Z0-9:@;?&=\/%\+\.\*!'\(\),\$_\{\}\^~\[\]`#|]+)/.source));
|
@ -1,6 +1,6 @@
|
||||
import React, { Component, Fragment } from "react";
|
||||
|
||||
import { scrollIsAtTop, scrollIsAtBottom } from "../../../../lib/util";
|
||||
import { scrollIsAtTop, scrollIsAtBottom } from "../../../../../logic/lib/util";
|
||||
|
||||
// Restore chat position on FF when new messages come in
|
||||
const recalculateScrollTop = (lastScrollHeight, scrollContainer) => {
|
@ -1,7 +1,7 @@
|
||||
import React, { Component } from 'react';
|
||||
import { OverlaySigil } from './overlay-sigil';
|
||||
import MessageContent from './message-content';
|
||||
import { uxToHex, cite, writeText } from '../../../../lib/util';
|
||||
import { uxToHex, cite, writeText } from '../../../../../logic/lib/util';
|
||||
import moment from 'moment';
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { Component } from 'react';
|
||||
|
||||
import { uxToHex } from '../../../../lib/util';
|
||||
import { uxToHex } from '../../../../../logic/lib/util';
|
||||
|
||||
|
||||
export class MetadataColor extends Component {
|
@ -2,7 +2,7 @@ import React, { Component } from 'react';
|
||||
|
||||
import { MetadataColor } from './metadata-color';
|
||||
import { MetadataInput } from './metadata-input';
|
||||
import { uxToHex } from '../../../../lib/util';
|
||||
import { uxToHex } from '../../../../../logic/lib/util';
|
||||
|
||||
|
||||
export const MetadataSettings = (props) => {
|
@ -1,5 +1,5 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Sigil } from '../../../../lib/sigil';
|
||||
import { Sigil } from '../../../../../logic/lib/sigil';
|
||||
import {
|
||||
ProfileOverlay,
|
||||
OVERLAY_HEIGHT
|
@ -1,7 +1,7 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { cite } from '../../../../lib/util';
|
||||
import { Sigil } from '../../../../lib/sigil';
|
||||
import { cite } from '../../../../../logic/lib/util';
|
||||
import { Sigil } from '../../../../../logic/lib/sigil';
|
||||
|
||||
export const OVERLAY_HEIGHT = 250;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { Component } from 'react';
|
||||
import S3Client from '../../../../lib/s3';
|
||||
import S3Client from '../../../../../logic/lib/s3';
|
||||
|
||||
export class S3Upload extends Component {
|
||||
constructor(props) {
|
@ -3,7 +3,7 @@ import { Spinner } from '../../../components/Spinner';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { InviteSearch } from '../../../components/InviteSearch';
|
||||
import urbitOb from 'urbit-ob';
|
||||
import { deSig } from '../../../lib/util';
|
||||
import { deSig } from '../../../../logic/lib/util';
|
||||
|
||||
export class NewDmScreen extends Component {
|
||||
constructor(props) {
|
@ -2,7 +2,7 @@ import React, { Component } from 'react';
|
||||
import { InviteSearch } from '../../../components/InviteSearch';
|
||||
import { Spinner } from '../../../components/Spinner';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { deSig } from '../../../lib/util';
|
||||
import { deSig } from '../../../../logic/lib/util';
|
||||
|
||||
export class NewScreen extends Component {
|
||||
constructor(props) {
|
@ -1,5 +1,5 @@
|
||||
import React, { Component, Fragment } from 'react';
|
||||
import { deSig } from '../../../lib/util';
|
||||
import { deSig } from '../../../../logic/lib/util';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import { ChatHeader } from './lib/chat-header';
|
@ -1,7 +1,7 @@
|
||||
import React, { Component } from 'react';
|
||||
|
||||
import Welcome from './lib/welcome';
|
||||
import { alphabetiseAssociations } from '../../../lib/util';
|
||||
import { alphabetiseAssociations } from '../../../../logic/lib/util';
|
||||
import SidebarInvite from '../../../components/SidebarInvite';
|
||||
import { GroupItem } from './lib/group-item';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { Component } from 'react';
|
||||
import { cite } from '../../../lib/util';
|
||||
import { cite } from '../../../../logic/lib/util';
|
||||
import { Spinner } from '../../../components/Spinner';
|
||||
|
||||
export class Input extends Component {
|
@ -11,10 +11,10 @@ import { AddScreen } from './components/lib/add-contact';
|
||||
import { JoinScreen } from './components/join';
|
||||
import GroupDetail from './components/lib/group-detail';
|
||||
|
||||
import { PatpNoSig } from '../../types/noun';
|
||||
import GlobalApi from '../../api/global';
|
||||
import { StoreState } from '../../store/type';
|
||||
import GlobalSubscription from '../../subscription/global';
|
||||
import { PatpNoSig } from '../../../types/noun';
|
||||
import GlobalApi from '../../../logic/api/global';
|
||||
import { StoreState } from '../../../logic/store/type';
|
||||
import GlobalSubscription from '../../../logic/subscription/global';
|
||||
|
||||
|
||||
type GroupsAppProps = StoreState & {
|
@ -1,10 +1,10 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Sigil } from '../../../../lib/sigil';
|
||||
import { Sigil } from '../../../../../logic/lib/sigil';
|
||||
|
||||
import { Link } from 'react-router-dom';
|
||||
import { EditElement } from './edit-element';
|
||||
import { Spinner } from '../../../../components/Spinner';
|
||||
import { uxToHex } from '../../../../lib/util';
|
||||
import { uxToHex } from '../../../../../logic/lib/util';
|
||||
import { S3Upload } from './s3-upload';
|
||||
|
||||
export class ContactCard extends Component {
|
@ -1,7 +1,7 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Sigil } from '../../../../lib/sigil';
|
||||
import { uxToHex, cite } from '../../../../lib/util';
|
||||
import { Sigil } from '../../../../../logic/lib/sigil';
|
||||
import { uxToHex, cite } from '../../../../../logic/lib/util';
|
||||
|
||||
export class ContactItem extends Component {
|
||||
render() {
|
@ -4,14 +4,14 @@ import { FixedSizeList as List } from 'react-window';
|
||||
|
||||
import { ContactItem } from './contact-item';
|
||||
import { ShareSheet } from './share-sheet';
|
||||
import { Sigil } from '../../../../lib/sigil';
|
||||
import { Sigil } from '../../../../../logic/lib/sigil';
|
||||
import { Spinner } from '../../../../components/Spinner';
|
||||
import { cite } from '../../../../lib/util';
|
||||
import { roleForShip, resourceFromPath } from '../../../../lib/group';
|
||||
import { Path, PatpNoSig } from '../../../../types/noun';
|
||||
import { Rolodex, Contacts, Contact } from '../../../../types/contact-update';
|
||||
import { Groups, Group } from '../../../../types/group-update';
|
||||
import GlobalApi from '../../../../api/global';
|
||||
import { cite } from '../../../../../logic/lib/util';
|
||||
import { roleForShip, resourceFromPath } from '../../../../../logic/lib/group';
|
||||
import { Path, PatpNoSig } from '../../../../../types/noun';
|
||||
import { Rolodex, Contacts, Contact } from '../../../../../types/contact-update';
|
||||
import { Groups, Group } from '../../../../../types/group-update';
|
||||
import GlobalApi from '../../../../../logic/api/global';
|
||||
|
||||
interface ContactSidebarProps {
|
||||
activeDrawer: 'contacts' | 'detail' | 'rightPanel';
|
@ -3,8 +3,9 @@ import { Link } from 'react-router-dom';
|
||||
import { Spinner } from '../../../../components/Spinner';
|
||||
import { Toggle } from '../../../../components/toggle';
|
||||
import { GroupView } from '../../../../components/Group';
|
||||
import { deSig, uxToHex, writeText } from '../../../../lib/util';
|
||||
import { roleForShip, resourceFromPath } from '../../../../lib/group';
|
||||
|
||||
import { deSig, uxToHex, writeText } from '../../../../../logic/lib/util';
|
||||
import { roleForShip, resourceFromPath } from '../../../../../logic/lib/group';
|
||||
|
||||
export class GroupDetail extends Component {
|
||||
constructor(props) {
|
@ -2,11 +2,12 @@ import React, { Component } from 'react';
|
||||
|
||||
import { Link } from 'react-router-dom';
|
||||
import { GroupItem } from './group-item';
|
||||
import { Sigil } from '../../../../lib/sigil';
|
||||
import SidebarInvite from '../../../../components/SidebarInvite';
|
||||
import { Welcome } from './welcome';
|
||||
|
||||
import { cite } from '../../../../lib/util';
|
||||
import { cite } from '../../../../../logic/lib/util';
|
||||
import { Sigil } from '../../../../../logic/lib/sigil';
|
||||
|
||||
|
||||
export class GroupSidebar extends Component {
|
||||
// drawer to the left
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user