Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

learn more link #22034

Merged
merged 4 commits into from
Jan 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions shared/chat/conversation/bot/channel-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ const ChannelPicker = (props: Props) => {
icon="iconfont-search"
placeholderText={`Search channels in ${props.teamName}`}
placeholderCentered={true}
mobileCancelButton={true}
hotkey="f"
onChange={setSearchText}
style={styles.searchFilter}
focusOnMount={true}
/>
</Kb.Box2>
<Kb.ScrollView style={styles.rowsContainer}>{rows}</Kb.ScrollView>
Expand Down Expand Up @@ -125,7 +124,7 @@ const styles = Styles.styleSheetCreate(
},
isElectron: {
maxHeight: 250,
minHeight: 250,
minHeight: 370,
},
}),
searchFilter: Styles.platformStyles({
Expand Down
50 changes: 38 additions & 12 deletions shared/chat/conversation/bot/install.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import * as TeamTypes from '../../../constants/types/teams'
import * as TeamConstants from '../../../constants/teams'
import * as Constants from '../../../constants/chat2'
import * as RPCTypes from '../../../constants/types/rpc-gen'
import openURL from '../../../util/open-url'
import ChannelPicker from './channel-picker'

const RestrictedItem = '---RESTRICTED---'
Expand Down Expand Up @@ -114,6 +115,9 @@ const InstallBotPopup = (props: Props) => {
const onClose = () => {
dispatch(RouteTreeGen.createClearModals())
}
const onLearn = () => {
openURL('https://keybase.io/docs/chat/restricted_bots')
}
const onLeftAction = () => {
if (installScreen) {
setInstallScreen(false)
Expand Down Expand Up @@ -220,14 +224,14 @@ const InstallBotPopup = (props: Props) => {
direction="vertical"
style={Styles.collapseStyles([styles.container, {flex: 1}])}
fullWidth={true}
gap="tiny"
gap="small"
>
<Kb.Box2 direction="vertical" gap="small" fullWidth={true}>
<Kb.Box2 direction="horizontal" gap="small" fullWidth={true}>
<Kb.Avatar username={botUsername} size={64} />
<Kb.Box2 direction="vertical" fullWidth={true} style={{flex: 1}} gap="tiny">
<Kb.Box2 direction="vertical" fullWidth={true}>
<Kb.Text type="BodyBigExtrabold">{featured.botAlias}</Kb.Text>
<Kb.Text type="BodySemibold">{featured.botAlias}</Kb.Text>
<Kb.ConnectedUsernames
colorFollowing={true}
type="BodySemibold"
Expand All @@ -247,6 +251,14 @@ const InstallBotPopup = (props: Props) => {
{inTeam && !inTeamUnrestricted && (
<PermsList channelInfos={channelInfos} settings={settings} username={botUsername} />
)}
{!inTeam && (
<Kb.Text type="BodySmall">
<Kb.Text type="BodySmallPrimaryLink" onClick={onLearn}>
Learn more
</Kb.Text>{' '}
about bots in Keybase.
</Kb.Text>
)}
</Kb.Box2>
)
const usernameContent = !featured && (
Expand All @@ -272,7 +284,7 @@ const InstallBotPopup = (props: Props) => {
<Kb.Avatar username={botUsername} size={64} />
<Kb.Box2 direction="vertical" fullWidth={true} style={{flex: 1}} gap="tiny">
<Kb.Box2 direction="vertical" fullWidth={true}>
<Kb.Text type="BodyBigExtrabold">{featured ? featured.botAlias : botUsername}</Kb.Text>
<Kb.Text type="BodySemibold">{featured ? featured.botAlias : botUsername}</Kb.Text>
<Kb.ConnectedUsernames
colorFollowing={true}
type="BodySemibold"
Expand Down Expand Up @@ -372,6 +384,12 @@ const InstallBotPopup = (props: Props) => {
: featured
? featuredContent
: usernameContent
const getHeight = () => {
if (channelPickerScreen) {
return 440
}
return 560
}
const showInstallButton = installScreen && !inTeam && !channelPickerScreen
const showReviewButton = !installScreen && !inTeam
const showRemoveButton = inTeam && !installScreen
Expand Down Expand Up @@ -509,7 +527,11 @@ const InstallBotPopup = (props: Props) => {
: undefined
}
>
<Kb.Box2 direction="vertical" style={styles.outerContainer} fullWidth={true}>
<Kb.Box2
direction="vertical"
style={Styles.collapseStyles([styles.outerContainer, {height: getHeight()}])}
fullWidth={true}
>
{enabled ? (
content
) : (
Expand Down Expand Up @@ -584,14 +606,18 @@ const PermsList = (props: PermsListProps) => {
<Kb.Box2 direction="vertical" gap="small" fullWidth={true}>
<Kb.Text type="BodySemibold">This bot can currently read:</Kb.Text>
{props.settings ? (
<Kb.Box2 direction="vertical" gap="tiny" fullWidth={true}>
{!(props.settings.cmds || props.settings.mentions) && (
<Kb.Text type="Body">{'• no messages, the bot is in write only mode'}</Kb.Text>
)}
{props.settings.cmds && <Kb.Text type="Body">{'• messages that begin with bot commands.'}</Kb.Text>}
{props.settings.mentions && (
<Kb.Text type="Body">{`• messages it has been mentioned in with @${props.username}`}</Kb.Text>
)}
<Kb.Box2 direction="vertical" gap="small" fullWidth={true}>
<Kb.Box2 direction="vertical" gap="tiny" fullWidth={true}>
{!(props.settings.cmds || props.settings.mentions) && (
<Kb.Text type="Body">{'• no messages, the bot is in write only mode'}</Kb.Text>
)}
{props.settings.cmds && (
<Kb.Text type="Body">{'• messages that begin with bot commands.'}</Kb.Text>
)}
{props.settings.mentions && (
<Kb.Text type="Body">{`• messages it has been mentioned in with @${props.username}`}</Kb.Text>
)}
</Kb.Box2>
{props.settings.convs && props.channelInfos && (
<Kb.Box2 direction="vertical" gap="tiny" fullWidth={true}>
<Kb.Text type="BodySemibold">In these channels:</Kb.Text>
Expand Down