Skip to content

Commit

Permalink
hide chat and fix ui breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
taronaleksanian committed Jul 27, 2024
1 parent ea74cf8 commit b00e8a7
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 34 deletions.
7 changes: 6 additions & 1 deletion packages/app/components/feed/FeedSearchFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,12 @@ const FeedSearchFilter = ({
</View>
</RStack>
{(feedType === 'userPacks' || feedType === 'userTrips') && (
<RButton onPress={handleCreateClick}>Create</RButton>
<RButton
style={{ marginLeft: 'auto', marginTop: 8 }}
onPress={handleCreateClick}
>
Create
</RButton>
)}
</RStack>
)}
Expand Down
20 changes: 11 additions & 9 deletions packages/app/components/item/ItemForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,17 @@ export const ItemForm = ({
width="100"
/>
) : (
<DropdownComponent
value={selectedUnit}
data={data}
onValueChange={handleUnitChange}
placeholder={selectedUnit}
width="50%"
native={true}
zeego={true}
/>
<View style={{ flex: 1 }}>
<DropdownComponent
value={selectedUnit}
data={data}
onValueChange={handleUnitChange}
placeholder={selectedUnit}
width="50%"
native={true}
zeego={true}
/>
</View>
))}
</View>
<FormInput
Expand Down
35 changes: 26 additions & 9 deletions packages/app/components/pack/PackDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import useResponsive from 'app/hooks/useResponsive';
import { FlatList, Platform, View } from 'react-native';
import { useFetchSinglePack } from '../../hooks/packs';
import ScoreContainer from '../ScoreContainer';
import ChatContainer from '../chat';
// import ChatContainer from '../chat';
import { TextLink } from '@packrat/crosspath';
import { DetailsComponent } from '../details';
import { TableContainer } from '../pack_table/Table';
import { AddItemModal } from './AddItemModal';
Expand Down Expand Up @@ -111,14 +112,29 @@ export function PackDetails() {
}
/>
</View>
) : null;
) : (
<RText
style={{ textAlign: 'center', fontWeight: 600 }}
>
<RText style={{ marginRight: 2 }}>
You don't have permission to edit this pack. You
can create your own pack{' '}
</RText>
<TextLink href="/pack/create">
<RText
style={{
color: 'blue',
fontWeight: 700,
}}
>
here
</RText>
</TextLink>
</RText>
);
case SECTION.SCORECARD:
return (
<View
style={{
minHeight: xxs ? 800 : xs ? 800 : xxl ? 100 : 800,
}}
>
<View>
<ScoreContainer
type="pack"
data={currentPack}
Expand Down Expand Up @@ -147,7 +163,8 @@ export function PackDetails() {
/>
</View>
)}
<View
{/* Disable Chat */}
{/* <View
style={{
position: 'absolute',
right: -40,
Expand All @@ -162,7 +179,7 @@ export function PackDetails() {
trigger="Open Chat"
type="pack"
/>
</View>
</View> */}
</Layout>
);
}
Expand Down
29 changes: 16 additions & 13 deletions packages/app/screens/items/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,23 @@ export default function Items() {
<RText style={{ fontWeight: 'bold', textWrap: 'nowrap' }}>
Sort By:
</RText>
<DropdownComponent
value={value}
data={optionValues}
onValueChange={handleSort}
placeholder={value}
width="80%"
native={true}
zeego={true}
/>
<View style={{ flex: 1 }}>
<DropdownComponent
value={value}
data={optionValues}
onValueChange={handleSort}
placeholder={value}
native={true}
zeego={true}
/>
</View>
</RStack>
<View
style={{
marginBottom: 10,
display: 'flex',
flexDirection: 'row',
justifyContent: 'flex-end',
gap: 5,
}}
>
Expand All @@ -100,7 +102,7 @@ export default function Items() {
</View>
</RStack>
{!isError && data?.items && Array.isArray(data.items) && (
<View style={{padding:10, width:'100%'}}>
<View style={{ padding: 10, width: '100%' }}>
<ItemsTable
limit={limit}
setLimit={handleLimitChange}
Expand All @@ -110,7 +112,7 @@ export default function Items() {
isLoading={isFetching}
totalPages={data?.totalPages}
/>
</View>
</View>
)}
</RStack>
</RScrollView>
Expand All @@ -137,14 +139,15 @@ const loadStyles = (theme) => {
},
container: {
backgroundColor: currentTheme.colors.card,
flexDirection: 'row',
flexDirection: xs || xxs ? 'column' : 'row',
gap: xs || xxs ? 4 : 0,
justifyContent: 'space-between',
width: '100%',
padding: 30,
borderRadius: 10,
},
sortContainer: {
width: xxs ? '50%' : xs ? '50%' : '20%',
width: xxs ? '100%' : xs ? '100%' : '20%',
justifyContent: 'space-between',
flexDirection: 'row',
alignItems: 'center',
Expand Down
2 changes: 1 addition & 1 deletion packages/crosspath/src/adapters/solito/components/Link.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { Link } from 'solito/link';
export { Link, TextLink } from 'solito/link';
2 changes: 1 addition & 1 deletion packages/crosspath/src/adapters/solito/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { createParam } from './createParam';
export { useRouter } from './useRouter';
export { Link } from './components/Link';
export * from './components/Link';
5 changes: 5 additions & 0 deletions packages/crosspath/src/adapters/tanstack/components/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ export const Link: LinkComponent = (props: LinkProps) => {
// @ts-ignore
return <TanstackLink to={props.href} {...props} />;
};

export const TextLink: LinkComponent = (props: LinkProps) => {
// @ts-ignore
return <TanstackLink to={props.href} {...props} />;
};
4 changes: 4 additions & 0 deletions packages/crosspath/src/lib-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ export declare function Link(
props: Parameters<LinkComponent>,
): ReturnType<LinkComponent>;

export declare function TextLinks(
props: Parameters<LinkComponent>,
): ReturnType<LinkComponent>;

export declare const createParam: CreateParam;
export declare function useRouter(): Router;

0 comments on commit b00e8a7

Please sign in to comment.