feat: instagram changes

This commit is contained in:
Nevo David 2024-11-17 17:24:39 +07:00
parent e047906c22
commit 56ec5bb6e0
2 changed files with 40 additions and 1 deletions

View File

@ -1,7 +1,42 @@
import { withProvider } from '@gitroom/frontend/components/launches/providers/high.order.provider';
import { FC } from 'react';
import { Select } from '@gitroom/react/form/select';
import { useSettings } from '@gitroom/frontend/components/launches/helpers/use.values';
const postType = [
{
value: 'post',
label: 'Post',
},
{
value: 'story',
label: 'Story',
},
];
const InstagramProvider: FC<{ values?: any }> = (props) => {
const { watch, register, formState, control } = useSettings();
return (
<>
<Select
label="Post Type"
{...register('post_type', {
value: '',
})}
>
<option value="">Select Post Type...</option>
{postType.map((item) => (
<option key={item.value} value={item.value}>
{item.label}
</option>
))}
</Select>
</>
);
};
export default withProvider(
null,
InstagramProvider,
undefined,
undefined,
async ([firstPost, ...otherPosts]) => {

View File

@ -377,4 +377,8 @@ export class InstagramProvider
})) || []
);
}
music(accessToken: string, data: {q: string}) {
return this.fetch(`https://graph.facebook.com/v20.0/music/search?q=${encodeURIComponent(data.q)}&access_token=${accessToken}`);
}
}