mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-06 23:16:29 +03:00
interface: fix tsc
This commit is contained in:
parent
2412564aa7
commit
e66d086c0d
@ -1,5 +1,5 @@
|
|||||||
import { Action, Anchor, Box, Col, Icon, Row, Rule, Text } from '@tlon/indigo-react';
|
import { Action, Anchor, Box, Col, Icon, Row, Rule, Text } from '@tlon/indigo-react';
|
||||||
import { Association, GraphNode, Group, markEachAsRead, removePosts, TextContent, UrlContent } from '@urbit/api';
|
import { Association, GraphNode, Group, markEachAsRead, removePosts, TextContent, UrlContent, ReferenceContent } from '@urbit/api';
|
||||||
import React, { ReactElement, RefObject, useCallback, useEffect, useRef } from 'react';
|
import React, { ReactElement, RefObject, useCallback, useEffect, useRef } from 'react';
|
||||||
import { Link, Redirect } from 'react-router-dom';
|
import { Link, Redirect } from 'react-router-dom';
|
||||||
import { roleForShip } from '~/logic/lib/group';
|
import { roleForShip } from '~/logic/lib/group';
|
||||||
@ -131,7 +131,7 @@ export const LinkItem = React.forwardRef((props: LinkItemProps, ref: RefObject<H
|
|||||||
{ 'reference' in contents[1] ? (
|
{ 'reference' in contents[1] ? (
|
||||||
<>
|
<>
|
||||||
<Rule />
|
<Rule />
|
||||||
<PermalinkEmbed full link={referenceToPermalink(contents[1]).link} transcluded={0} />
|
<PermalinkEmbed full link={referenceToPermalink(contents[1] as unknown as ReferenceContent).link} transcluded={0} />
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
|
@ -15,8 +15,8 @@ class TermApp extends Component {
|
|||||||
store: Store;
|
store: Store;
|
||||||
api: any;
|
api: any;
|
||||||
subscription: any;
|
subscription: any;
|
||||||
props: any;
|
declare props: any;
|
||||||
state: any;
|
declare state: any;
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.store = new Store();
|
this.store = new Store();
|
||||||
@ -32,6 +32,7 @@ class TermApp extends Component {
|
|||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.resetControllers();
|
this.resetControllers();
|
||||||
|
// eslint-disable-next-line new-cap
|
||||||
const channel = new (window as any).channel();
|
const channel = new (window as any).channel();
|
||||||
this.api = new Api(this.props.ship, channel);
|
this.api = new Api(this.props.ship, channel);
|
||||||
this.store.api = this.api;
|
this.store.api = this.api;
|
||||||
|
@ -3,7 +3,7 @@ import React, { Component } from 'react';
|
|||||||
|
|
||||||
export class Input extends Component {
|
export class Input extends Component {
|
||||||
inputRef: React.RefObject<unknown>;
|
inputRef: React.RefObject<unknown>;
|
||||||
props: any;
|
declare props: any;
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {};
|
this.state = {};
|
||||||
@ -90,9 +90,8 @@ belt = { met: 'bac' };
|
|||||||
if (line) {
|
if (line) {
|
||||||
if (line.lin) {
|
if (line.lin) {
|
||||||
prompt = line.lin.join('');
|
prompt = line.lin.join('');
|
||||||
}
|
} else if (line.klr) {
|
||||||
// TODO render prompt style
|
// TODO render prompt style
|
||||||
else if (line.klr) {
|
|
||||||
prompt = line.klr.reduce((l, p) => (l + p.text.join('')), '');
|
prompt = line.klr.reduce((l, p) => (l + p.text.join('')), '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,8 @@ function last<T>(arr: T[]) {
|
|||||||
return arr[arr.length - 1];
|
return arr[arr.length - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getChildren<T extends Record<string, unknown>>(node: T): AstContent[] {
|
function getChildren<T extends unknown>(node: T): AstContent[] {
|
||||||
|
// @ts-ignore TODO @liam-fitzgerald
|
||||||
if ('children' in node) {
|
if ('children' in node) {
|
||||||
// @ts-ignore TODO @liam-fitzgerald
|
// @ts-ignore TODO @liam-fitzgerald
|
||||||
return node.children;
|
return node.children;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Box, Col, Text } from '@tlon/indigo-react';
|
import { Box, Col, Text } from '@tlon/indigo-react';
|
||||||
import { Association, groupifyGraph } from '@urbit/api';
|
import { Association, groupifyGraph, AppName } from '@urbit/api';
|
||||||
import { Form, Formik, FormikHelpers } from 'formik';
|
import { Form, Formik, FormikHelpers } from 'formik';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
@ -38,7 +38,7 @@ export function GroupifyForm(props: GroupifyFormProps) {
|
|||||||
));
|
));
|
||||||
let mod = association['app-name'];
|
let mod = association['app-name'];
|
||||||
if (association?.metadata?.config && 'graph' in association.metadata.config) {
|
if (association?.metadata?.config && 'graph' in association.metadata.config) {
|
||||||
mod = association.metadata.config.graph;
|
mod = association.metadata.config.graph as AppName;
|
||||||
}
|
}
|
||||||
const newGroup = values.group || association.group;
|
const newGroup = values.group || association.group;
|
||||||
history.push(`/~landscape${newGroup}/resource/${mod}${rid}`);
|
history.push(`/~landscape${newGroup}/resource/${mod}${rid}`);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { Association } from '@urbit/api/metadata';
|
import { Association } from '@urbit/api/metadata';
|
||||||
|
import { AppName } from '@urbit/api';
|
||||||
import React, { ReactElement } from 'react';
|
import React, { ReactElement } from 'react';
|
||||||
import Helmet from 'react-helmet';
|
import Helmet from 'react-helmet';
|
||||||
import { Route, Switch } from 'react-router-dom';
|
import { Route, Switch } from 'react-router-dom';
|
||||||
@ -27,7 +28,7 @@ export function Resource(props: ResourceProps): ReactElement {
|
|||||||
const contacts = useContactState(state => state.contacts);
|
const contacts = useContactState(state => state.contacts);
|
||||||
let app = association['app-name'];
|
let app = association['app-name'];
|
||||||
if (association?.metadata?.config && 'graph' in association.metadata.config) {
|
if (association?.metadata?.config && 'graph' in association.metadata.config) {
|
||||||
app = association.metadata.config.graph;
|
app = association.metadata.config.graph as AppName;
|
||||||
}
|
}
|
||||||
const { resource: rid, group: selectedGroup } = association;
|
const { resource: rid, group: selectedGroup } = association;
|
||||||
const relativePath = (p: string) => `${props.baseUrl}/resource/${app}${rid}${p}`;
|
const relativePath = (p: string) => `${props.baseUrl}/resource/${app}${rid}${p}`;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { Box, Col, Icon, Text } from '@tlon/indigo-react';
|
import { Box, Col, Icon, Text } from '@tlon/indigo-react';
|
||||||
import { Association } from '@urbit/api/metadata';
|
import { Association } from '@urbit/api/metadata';
|
||||||
|
import { AppName } from '@urbit/api';
|
||||||
import React, { ReactElement, ReactNode, useCallback, useState } from 'react';
|
import React, { ReactElement, ReactNode, useCallback, useState } from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
@ -66,7 +67,7 @@ export function ResourceSkeleton(props: ResourceSkeletonProps): ReactElement {
|
|||||||
const { association, baseUrl, children } = props;
|
const { association, baseUrl, children } = props;
|
||||||
let app = association['app-name'];
|
let app = association['app-name'];
|
||||||
if (association?.metadata?.config && 'graph' in association.metadata.config) {
|
if (association?.metadata?.config && 'graph' in association.metadata.config) {
|
||||||
app = association.metadata.config.graph;
|
app = association.metadata.config.graph as AppName;
|
||||||
}
|
}
|
||||||
const rid = association.resource;
|
const rid = association.resource;
|
||||||
const groups = useGroupState(state => state.groups);
|
const groups = useGroupState(state => state.groups);
|
||||||
|
@ -2,7 +2,7 @@ import _ from 'lodash';
|
|||||||
import React, { useRef, ReactNode } from 'react';
|
import React, { useRef, ReactNode } from 'react';
|
||||||
import urbitOb from 'urbit-ob';
|
import urbitOb from 'urbit-ob';
|
||||||
import { Icon, Row, Box, Text, BaseImage } from '@tlon/indigo-react';
|
import { Icon, Row, Box, Text, BaseImage } from '@tlon/indigo-react';
|
||||||
import { Association, cite } from '@urbit/api';
|
import { Association, cite, AppName } from '@urbit/api';
|
||||||
import { HoverBoxLink } from '~/views/components/HoverBox';
|
import { HoverBoxLink } from '~/views/components/HoverBox';
|
||||||
import { Sigil } from '~/logic/lib/sigil';
|
import { Sigil } from '~/logic/lib/sigil';
|
||||||
import { useTutorialModal } from '~/views/components/useTutorialModal';
|
import { useTutorialModal } from '~/views/components/useTutorialModal';
|
||||||
@ -178,7 +178,7 @@ export const SidebarAssociationItem = React.memo((props: {
|
|||||||
const appName = association?.['app-name'];
|
const appName = association?.['app-name'];
|
||||||
let mod = appName;
|
let mod = appName;
|
||||||
if (association?.metadata?.config && 'graph' in association.metadata.config) {
|
if (association?.metadata?.config && 'graph' in association.metadata.config) {
|
||||||
mod = association.metadata.config.graph;
|
mod = association.metadata.config.graph as AppName;
|
||||||
}
|
}
|
||||||
const rid = association?.resource;
|
const rid = association?.resource;
|
||||||
const groupPath = association?.group;
|
const groupPath = association?.group;
|
||||||
@ -270,7 +270,7 @@ export const SidebarAssociationItem = React.memo((props: {
|
|||||||
<Icon
|
<Icon
|
||||||
display="block"
|
display="block"
|
||||||
color={isSynced ? 'black' : 'lightGray'}
|
color={isSynced ? 'black' : 'lightGray'}
|
||||||
icon={getModuleIcon(mod)}
|
icon={getModuleIcon(mod as any)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</SidebarItemBase>
|
</SidebarItemBase>
|
||||||
|
Loading…
Reference in New Issue
Block a user